diff --git a/.gitignore b/.gitignore index f00fb36ba05044a59b8b2096cbb144bbe7792cd2..7955477f50d9f1d644566b0a4e1dee931006a648 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ builds/ # ignore systemc build bundles/fr.irisa.cairn.idfix.utils/resources/systemc-2.3.0/build/ bundles/fr.irisa.cairn.idfix.utils/resources/env.cfg + diff --git a/README.md b/README.md index c01c1e6a68bfd8ce1ee2f5ed22258e208ac4d126..09d184a637ed5143d49df69f5784a25a2d9882e3 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,23 @@ This repository contains multiple projects related to float-to-fix converstion. -The following is about typeexploration.* projects, initially written by Antoine Morvan. +The following is about building and running ```typeexploration.*``` projects, initially written by Antoine Morvan. -Building Gecos F2F-dev - 2019-01 -===================== +Gecos Type Exploration Flow +=========================== -Objective : build Gecos float2fix source from sources in Eclipse and run it +Objectives : +* build Gecos float2fix source from sources in Eclipse and run it; + * See [this page](https://gitlab.inria.fr/gecos/gecos-core/wikis/home) for installing from Update Site; +* User documentation is available here [bundles/fr.irisa.cairn.gecos.typeexploration/USER_GUIDE.md](bundles/fr.irisa.cairn.gecos.typeexploration/USER_GUIDE.md); +* Demos are located in the [fr.irisa.cairn.gecos.typeexploration.demo](bundles/fr.irisa.cairn.gecos.typeexploration.demo) project; + * If proper plugins are exported Eclipse Wizard is also available (New / Example... / Gecos / GeCoS Type Exporation); -## Requirements +## Building the Flow from Source -Make sure to have Java 8+ and Maven 3.5.0+ installed on your system. +### Requirements -## Download Required Projects +Make sure to have Java 8+ and Maven 3.5.0+ installed on your system. Building Maven projects and installing Eclipse plugins requires Internet connection. + +### Download Required Projects from Git Repository From https://gitlab.inria.fr/gecos, clone following repositories: * gecos-builtools @@ -26,7 +33,7 @@ From https://gitlab.inria.fr/gecos, clone following repositories:  -## Install Parent Project in Local M2 repo +### Install Parent Project in Local M2 repo In order to prevent errors in later Maven resolving steps when building with Eclipse, it is necessary to first install the **gecos-buildtools** project in the local Maven repository. To do so, open a terminal in the **gecos-buildtools** and run **mvn clean install** @@ -35,7 +42,7 @@ $ cd ~/git/gecos-buildtools/ $ mvn clean install ``` -## Setup Eclipse and required Plugins +### Setup Eclipse and required Plugins In order to build Gecos F2F in Eclipse, you need a set of extra plugins to support Xtext and Xtend. 1. Downlad Eclipse Modeling Tools from packages list at https://www.eclipse.org/downloads/packages/release/2018-12/r/eclipse-modeling-tools @@ -49,7 +56,7 @@ In order to build Gecos F2F in Eclipse, you need a set of extra plugins to suppo * Modeling / MWE 2 language SDK 6. Click on Next then follow procedure then restart Eclipse when asked -## Import Projects and Build +### Import Projects and Build After Eclipse restart, import and build projects: 1. File / Import ... @@ -67,7 +74,7 @@ After Eclipse restart, import and build projects: * fr.irisa.cairn.eclipse.tom/src 8. If some errors are still present, click on Project / Clean ... and clean all projets. -## Run Gecos F2F +### Run Gecos F2F 1. The exploration tool is invoked by Compiler Script commands 2. Command TypesExploration takes a GecosProject and a path to property file diff --git a/bundles/fr.irisa.cairn.float2fix.model.extended.c.code.generator/xtend-gen/fr/irisa/cairn/float2fix/model/extended/c/code/generator/xtend/GIDFixInstrTemplate.java b/bundles/fr.irisa.cairn.float2fix.model.extended.c.code.generator/xtend-gen/fr/irisa/cairn/float2fix/model/extended/c/code/generator/xtend/GIDFixInstrTemplate.java index 3f3646ed920ad5ffb30efadbe1eb9d882fb59c86..01da12d3df86cbd8fca6051b6065903057267d8b 100644 --- a/bundles/fr.irisa.cairn.float2fix.model.extended.c.code.generator/xtend-gen/fr/irisa/cairn/float2fix/model/extended/c/code/generator/xtend/GIDFixInstrTemplate.java +++ b/bundles/fr.irisa.cairn.float2fix.model.extended.c.code.generator/xtend-gen/fr/irisa/cairn/float2fix/model/extended/c/code/generator/xtend/GIDFixInstrTemplate.java @@ -7,6 +7,7 @@ import gecos.extended.instrs.NewArrayInstruction; import gecos.extended.instrs.NewInstruction; import gecos.instrs.Instruction; import java.util.Arrays; +import javax.annotation.Generated; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; import org.eclipse.xtend2.lib.StringConcatenation; @@ -14,6 +15,7 @@ import org.eclipse.xtext.xbase.lib.IntegerRange; import org.eclipse.xtext.xbase.lib.IterableExtensions; @SuppressWarnings("all") +@Generated(value = "org.eclipse.xtend.core.compiler.XtendGenerator", date = "2019-04-08T14:12+0200") public class GIDFixInstrTemplate extends GIDFixTemplate { protected Object _generate(final EObject object) { return null; diff --git a/bundles/fr.irisa.cairn.float2fix.model.extended.c.code.generator/xtend-gen/fr/irisa/cairn/float2fix/model/extended/c/code/generator/xtend/GIDFixTemplate.java b/bundles/fr.irisa.cairn.float2fix.model.extended.c.code.generator/xtend-gen/fr/irisa/cairn/float2fix/model/extended/c/code/generator/xtend/GIDFixTemplate.java index 3c298ea9da5232f57cfab70ca87bd3b0e72b4453..9bb65560d6ee63f367afc5769e62cb54e0c2a902 100644 --- a/bundles/fr.irisa.cairn.float2fix.model.extended.c.code.generator/xtend-gen/fr/irisa/cairn/float2fix/model/extended/c/code/generator/xtend/GIDFixTemplate.java +++ b/bundles/fr.irisa.cairn.float2fix.model.extended.c.code.generator/xtend-gen/fr/irisa/cairn/float2fix/model/extended/c/code/generator/xtend/GIDFixTemplate.java @@ -1,9 +1,11 @@ package fr.irisa.cairn.float2fix.model.extended.c.code.generator.xtend; import fr.irisa.cairn.gecos.model.extensions.generators.IGecosCodeGenerator; +import javax.annotation.Generated; import org.eclipse.emf.ecore.EObject; @SuppressWarnings("all") +@Generated(value = "org.eclipse.xtend.core.compiler.XtendGenerator", date = "2019-04-08T14:12+0200") public class GIDFixTemplate implements IGecosCodeGenerator { public Object generate(final EObject o) { return null; diff --git a/bundles/fr.irisa.cairn.float2fix.model.extended.c.code.generator/xtend-gen/fr/irisa/cairn/float2fix/model/extended/c/code/generator/xtend/GIDFixTypeTemplate.java b/bundles/fr.irisa.cairn.float2fix.model.extended.c.code.generator/xtend-gen/fr/irisa/cairn/float2fix/model/extended/c/code/generator/xtend/GIDFixTypeTemplate.java index a30613d49a17bfabf8dbce56b356661c53526236..935692ba7791e3f41669071474a6b698e831b29e 100644 --- a/bundles/fr.irisa.cairn.float2fix.model.extended.c.code.generator/xtend-gen/fr/irisa/cairn/float2fix/model/extended/c/code/generator/xtend/GIDFixTypeTemplate.java +++ b/bundles/fr.irisa.cairn.float2fix.model.extended.c.code.generator/xtend-gen/fr/irisa/cairn/float2fix/model/extended/c/code/generator/xtend/GIDFixTypeTemplate.java @@ -9,10 +9,12 @@ import gecos.extended.types.SCFixedType; import gecos.extended.types.SCUFixType; import gecos.extended.types.SCUFixedType; import java.util.Arrays; +import javax.annotation.Generated; import org.eclipse.emf.ecore.EObject; import org.eclipse.xtend2.lib.StringConcatenation; @SuppressWarnings("all") +@Generated(value = "org.eclipse.xtend.core.compiler.XtendGenerator", date = "2019-04-08T14:12+0200") public class GIDFixTypeTemplate extends GIDFixTemplate { protected Object _generate(final SCFixType o) { CharSequence _xblockexpression = null; diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/ComputationParser.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/ComputationParser.java index e82aa1757678b8cc9d4790c2f0f7177fc7a0abe3..b22607921230157f66f7ea3038ca1c8650fa11ce 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/ComputationParser.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/ComputationParser.java @@ -38,6 +38,8 @@ public class ComputationParser extends AbstractContentAssistParser { builder.put(grammarAccess.getComputationModelAccess().getGroup(), "rule__ComputationModel__Group__0"); builder.put(grammarAccess.getParameterAccess().getGroup(), "rule__Parameter__Group__0"); builder.put(grammarAccess.getHWTargetDesignAccess().getGroup(), "rule__HWTargetDesign__Group__0"); + builder.put(grammarAccess.getBlockGroupAccess().getGroup(), "rule__BlockGroup__Group__0"); + builder.put(grammarAccess.getBlockGroupAccess().getGroup_4(), "rule__BlockGroup__Group_4__0"); builder.put(grammarAccess.getComputationBlockAccess().getGroup(), "rule__ComputationBlock__Group__0"); builder.put(grammarAccess.getOperationAccess().getGroup(), "rule__Operation__Group__0"); builder.put(grammarAccess.getMaxExpressionAccess().getGroup(), "rule__MaxExpression__Group__0"); @@ -52,12 +54,16 @@ public class ComputationParser extends AbstractContentAssistParser { builder.put(grammarAccess.getProductExpressionAccess().getGroup_1(), "rule__ProductExpression__Group_1__0"); builder.put(grammarAccess.getComputationModelAccess().getParametersAssignment_0(), "rule__ComputationModel__ParametersAssignment_0"); builder.put(grammarAccess.getComputationModelAccess().getTargetDesignAssignment_1(), "rule__ComputationModel__TargetDesignAssignment_1"); - builder.put(grammarAccess.getComputationModelAccess().getBlocksAssignment_2(), "rule__ComputationModel__BlocksAssignment_2"); + builder.put(grammarAccess.getComputationModelAccess().getBlockGroupsAssignment_2(), "rule__ComputationModel__BlockGroupsAssignment_2"); + builder.put(grammarAccess.getComputationModelAccess().getBlocksAssignment_3(), "rule__ComputationModel__BlocksAssignment_3"); builder.put(grammarAccess.getParameterAccess().getNameAssignment_1(), "rule__Parameter__NameAssignment_1"); builder.put(grammarAccess.getParameterAccess().getValueAssignment_3(), "rule__Parameter__ValueAssignment_3"); builder.put(grammarAccess.getHWTargetDesignAccess().getFrequencyAssignment_4(), "rule__HWTargetDesign__FrequencyAssignment_4"); builder.put(grammarAccess.getHWTargetDesignAccess().getOutputsPerCycleAssignment_7(), "rule__HWTargetDesign__OutputsPerCycleAssignment_7"); builder.put(grammarAccess.getHWTargetDesignAccess().getProblemSizeExprAssignment_10(), "rule__HWTargetDesign__ProblemSizeExprAssignment_10"); + builder.put(grammarAccess.getBlockGroupAccess().getNameAssignment_1(), "rule__BlockGroup__NameAssignment_1"); + builder.put(grammarAccess.getBlockGroupAccess().getBlocksAssignment_3(), "rule__BlockGroup__BlocksAssignment_3"); + builder.put(grammarAccess.getBlockGroupAccess().getBlocksAssignment_4_1(), "rule__BlockGroup__BlocksAssignment_4_1"); builder.put(grammarAccess.getComputationBlockAccess().getNameAssignment_1(), "rule__ComputationBlock__NameAssignment_1"); builder.put(grammarAccess.getComputationBlockAccess().getOperationsAssignment_3(), "rule__ComputationBlock__OperationsAssignment_3"); builder.put(grammarAccess.getOperationAccess().getOpTypeAssignment_0(), "rule__Operation__OpTypeAssignment_0"); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputation.g b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputation.g index 1a1d75dabd74f6d9bf5fa4c7ef3fb04762cc1f59..c6ff6482b25bf5e57206d9d989adf37218622190 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputation.g +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputation.g @@ -124,6 +124,31 @@ finally { restoreStackSize(stackSize); } +// Entry rule entryRuleBlockGroup +entryRuleBlockGroup +: +{ before(grammarAccess.getBlockGroupRule()); } + ruleBlockGroup +{ after(grammarAccess.getBlockGroupRule()); } + EOF +; + +// Rule BlockGroup +ruleBlockGroup + @init { + int stackSize = keepStackSize(); + } + : + ( + { before(grammarAccess.getBlockGroupAccess().getGroup()); } + (rule__BlockGroup__Group__0) + { after(grammarAccess.getBlockGroupAccess().getGroup()); } + ) +; +finally { + restoreStackSize(stackSize); +} + // Entry rule entryRuleComputationBlock entryRuleComputationBlock : @@ -518,6 +543,7 @@ rule__ComputationModel__Group__2 } : rule__ComputationModel__Group__2__Impl + rule__ComputationModel__Group__3 ; finally { restoreStackSize(stackSize); @@ -528,16 +554,42 @@ rule__ComputationModel__Group__2__Impl int stackSize = keepStackSize(); } : +( + { before(grammarAccess.getComputationModelAccess().getBlockGroupsAssignment_2()); } + (rule__ComputationModel__BlockGroupsAssignment_2)* + { after(grammarAccess.getComputationModelAccess().getBlockGroupsAssignment_2()); } +) +; +finally { + restoreStackSize(stackSize); +} + +rule__ComputationModel__Group__3 + @init { + int stackSize = keepStackSize(); + } +: + rule__ComputationModel__Group__3__Impl +; +finally { + restoreStackSize(stackSize); +} + +rule__ComputationModel__Group__3__Impl + @init { + int stackSize = keepStackSize(); + } +: ( ( - { before(grammarAccess.getComputationModelAccess().getBlocksAssignment_2()); } - (rule__ComputationModel__BlocksAssignment_2) - { after(grammarAccess.getComputationModelAccess().getBlocksAssignment_2()); } + { before(grammarAccess.getComputationModelAccess().getBlocksAssignment_3()); } + (rule__ComputationModel__BlocksAssignment_3) + { after(grammarAccess.getComputationModelAccess().getBlocksAssignment_3()); } ) ( - { before(grammarAccess.getComputationModelAccess().getBlocksAssignment_2()); } - (rule__ComputationModel__BlocksAssignment_2)* - { after(grammarAccess.getComputationModelAccess().getBlocksAssignment_2()); } + { before(grammarAccess.getComputationModelAccess().getBlocksAssignment_3()); } + (rule__ComputationModel__BlocksAssignment_3)* + { after(grammarAccess.getComputationModelAccess().getBlocksAssignment_3()); } ) ) ; @@ -1005,6 +1057,222 @@ finally { } +rule__BlockGroup__Group__0 + @init { + int stackSize = keepStackSize(); + } +: + rule__BlockGroup__Group__0__Impl + rule__BlockGroup__Group__1 +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__Group__0__Impl + @init { + int stackSize = keepStackSize(); + } +: +( + { before(grammarAccess.getBlockGroupAccess().getGroupKeyword_0()); } + 'group' + { after(grammarAccess.getBlockGroupAccess().getGroupKeyword_0()); } +) +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__Group__1 + @init { + int stackSize = keepStackSize(); + } +: + rule__BlockGroup__Group__1__Impl + rule__BlockGroup__Group__2 +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__Group__1__Impl + @init { + int stackSize = keepStackSize(); + } +: +( + { before(grammarAccess.getBlockGroupAccess().getNameAssignment_1()); } + (rule__BlockGroup__NameAssignment_1) + { after(grammarAccess.getBlockGroupAccess().getNameAssignment_1()); } +) +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__Group__2 + @init { + int stackSize = keepStackSize(); + } +: + rule__BlockGroup__Group__2__Impl + rule__BlockGroup__Group__3 +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__Group__2__Impl + @init { + int stackSize = keepStackSize(); + } +: +( + { before(grammarAccess.getBlockGroupAccess().getLeftCurlyBracketKeyword_2()); } + '{' + { after(grammarAccess.getBlockGroupAccess().getLeftCurlyBracketKeyword_2()); } +) +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__Group__3 + @init { + int stackSize = keepStackSize(); + } +: + rule__BlockGroup__Group__3__Impl + rule__BlockGroup__Group__4 +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__Group__3__Impl + @init { + int stackSize = keepStackSize(); + } +: +( + { before(grammarAccess.getBlockGroupAccess().getBlocksAssignment_3()); } + (rule__BlockGroup__BlocksAssignment_3) + { after(grammarAccess.getBlockGroupAccess().getBlocksAssignment_3()); } +) +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__Group__4 + @init { + int stackSize = keepStackSize(); + } +: + rule__BlockGroup__Group__4__Impl + rule__BlockGroup__Group__5 +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__Group__4__Impl + @init { + int stackSize = keepStackSize(); + } +: +( + { before(grammarAccess.getBlockGroupAccess().getGroup_4()); } + (rule__BlockGroup__Group_4__0)* + { after(grammarAccess.getBlockGroupAccess().getGroup_4()); } +) +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__Group__5 + @init { + int stackSize = keepStackSize(); + } +: + rule__BlockGroup__Group__5__Impl +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__Group__5__Impl + @init { + int stackSize = keepStackSize(); + } +: +( + { before(grammarAccess.getBlockGroupAccess().getRightCurlyBracketKeyword_5()); } + '}' + { after(grammarAccess.getBlockGroupAccess().getRightCurlyBracketKeyword_5()); } +) +; +finally { + restoreStackSize(stackSize); +} + + +rule__BlockGroup__Group_4__0 + @init { + int stackSize = keepStackSize(); + } +: + rule__BlockGroup__Group_4__0__Impl + rule__BlockGroup__Group_4__1 +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__Group_4__0__Impl + @init { + int stackSize = keepStackSize(); + } +: +( + { before(grammarAccess.getBlockGroupAccess().getCommaKeyword_4_0()); } + ',' + { after(grammarAccess.getBlockGroupAccess().getCommaKeyword_4_0()); } +) +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__Group_4__1 + @init { + int stackSize = keepStackSize(); + } +: + rule__BlockGroup__Group_4__1__Impl +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__Group_4__1__Impl + @init { + int stackSize = keepStackSize(); + } +: +( + { before(grammarAccess.getBlockGroupAccess().getBlocksAssignment_4_1()); } + (rule__BlockGroup__BlocksAssignment_4_1) + { after(grammarAccess.getBlockGroupAccess().getBlocksAssignment_4_1()); } +) +; +finally { + restoreStackSize(stackSize); +} + + rule__ComputationBlock__Group__0 @init { int stackSize = keepStackSize(); @@ -2156,15 +2424,30 @@ finally { restoreStackSize(stackSize); } -rule__ComputationModel__BlocksAssignment_2 +rule__ComputationModel__BlockGroupsAssignment_2 @init { int stackSize = keepStackSize(); } : ( - { before(grammarAccess.getComputationModelAccess().getBlocksComputationBlockParserRuleCall_2_0()); } + { before(grammarAccess.getComputationModelAccess().getBlockGroupsBlockGroupParserRuleCall_2_0()); } + ruleBlockGroup + { after(grammarAccess.getComputationModelAccess().getBlockGroupsBlockGroupParserRuleCall_2_0()); } + ) +; +finally { + restoreStackSize(stackSize); +} + +rule__ComputationModel__BlocksAssignment_3 + @init { + int stackSize = keepStackSize(); + } +: + ( + { before(grammarAccess.getComputationModelAccess().getBlocksComputationBlockParserRuleCall_3_0()); } ruleComputationBlock - { after(grammarAccess.getComputationModelAccess().getBlocksComputationBlockParserRuleCall_2_0()); } + { after(grammarAccess.getComputationModelAccess().getBlocksComputationBlockParserRuleCall_3_0()); } ) ; finally { @@ -2246,6 +2529,59 @@ finally { restoreStackSize(stackSize); } +rule__BlockGroup__NameAssignment_1 + @init { + int stackSize = keepStackSize(); + } +: + ( + { before(grammarAccess.getBlockGroupAccess().getNameIDTerminalRuleCall_1_0()); } + RULE_ID + { after(grammarAccess.getBlockGroupAccess().getNameIDTerminalRuleCall_1_0()); } + ) +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__BlocksAssignment_3 + @init { + int stackSize = keepStackSize(); + } +: + ( + { before(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockCrossReference_3_0()); } + ( + { before(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockIDTerminalRuleCall_3_0_1()); } + RULE_ID + { after(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockIDTerminalRuleCall_3_0_1()); } + ) + { after(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockCrossReference_3_0()); } + ) +; +finally { + restoreStackSize(stackSize); +} + +rule__BlockGroup__BlocksAssignment_4_1 + @init { + int stackSize = keepStackSize(); + } +: + ( + { before(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockCrossReference_4_1_0()); } + ( + { before(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockIDTerminalRuleCall_4_1_0_1()); } + RULE_ID + { after(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockIDTerminalRuleCall_4_1_0_1()); } + ) + { after(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockCrossReference_4_1_0()); } + ) +; +finally { + restoreStackSize(stackSize); +} + rule__ComputationBlock__NameAssignment_1 @init { int stackSize = keepStackSize(); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputation.tokens b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputation.tokens index cc724ad0c759705482a181f32416ed3211f9bad1..e74f43495e326bc8dce54458f306a9554d0738f8 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputation.tokens +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputation.tokens @@ -1,21 +1,22 @@ -'('=27 -')'=28 -'+'=30 -','=29 -':'=23 +'('=29 +')'=30 +'+'=31 +','=23 +':'=25 ';'=15 '='=14 'ADD'=11 'MUL'=12 -'block'=22 +'block'=24 'frequency'=18 -'max'=26 -'op'=24 +'group'=22 +'max'=28 +'op'=26 'outputsPerCycle'=19 'param'=13 'problemSize'=20 'target'=16 -'x'=25 +'x'=27 '{'=17 '}'=21 RULE_ANY_OTHER=10 @@ -45,3 +46,4 @@ T__27=27 T__28=28 T__29=29 T__30=30 +T__31=31 diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputationLexer.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputationLexer.java index 2eb7ee6d40a56c95b4221e49aca2f6f283a503e7..df32b8abc8e0b092634ddc2f53f4dddeb3ff9fb0 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputationLexer.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputationLexer.java @@ -25,6 +25,7 @@ public class InternalComputationLexer extends Lexer { public static final int T__14=14; public static final int EOF=-1; public static final int T__30=30; + public static final int T__31=31; public static final int RULE_ID=4; public static final int RULE_WS=9; public static final int RULE_ANY_OTHER=10; @@ -286,10 +287,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__22; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:22:7: ( 'block' ) - // InternalComputation.g:22:9: 'block' + // InternalComputation.g:22:7: ( 'group' ) + // InternalComputation.g:22:9: 'group' { - match("block"); + match("group"); } @@ -307,10 +308,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__23; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:23:7: ( ':' ) - // InternalComputation.g:23:9: ':' + // InternalComputation.g:23:7: ( ',' ) + // InternalComputation.g:23:9: ',' { - match(':'); + match(','); } @@ -327,10 +328,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__24; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:24:7: ( 'op' ) - // InternalComputation.g:24:9: 'op' + // InternalComputation.g:24:7: ( 'block' ) + // InternalComputation.g:24:9: 'block' { - match("op"); + match("block"); } @@ -348,10 +349,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__25; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:25:7: ( 'x' ) - // InternalComputation.g:25:9: 'x' + // InternalComputation.g:25:7: ( ':' ) + // InternalComputation.g:25:9: ':' { - match('x'); + match(':'); } @@ -368,10 +369,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__26; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:26:7: ( 'max' ) - // InternalComputation.g:26:9: 'max' + // InternalComputation.g:26:7: ( 'op' ) + // InternalComputation.g:26:9: 'op' { - match("max"); + match("op"); } @@ -389,10 +390,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__27; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:27:7: ( '(' ) - // InternalComputation.g:27:9: '(' + // InternalComputation.g:27:7: ( 'x' ) + // InternalComputation.g:27:9: 'x' { - match('('); + match('x'); } @@ -409,10 +410,11 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__28; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:28:7: ( ')' ) - // InternalComputation.g:28:9: ')' + // InternalComputation.g:28:7: ( 'max' ) + // InternalComputation.g:28:9: 'max' { - match(')'); + match("max"); + } @@ -429,10 +431,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__29; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:29:7: ( ',' ) - // InternalComputation.g:29:9: ',' + // InternalComputation.g:29:7: ( '(' ) + // InternalComputation.g:29:9: '(' { - match(','); + match('('); } @@ -449,10 +451,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__30; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:30:7: ( '+' ) - // InternalComputation.g:30:9: '+' + // InternalComputation.g:30:7: ( ')' ) + // InternalComputation.g:30:9: ')' { - match('+'); + match(')'); } @@ -464,15 +466,35 @@ public class InternalComputationLexer extends Lexer { } // $ANTLR end "T__30" + // $ANTLR start "T__31" + public final void mT__31() throws RecognitionException { + try { + int _type = T__31; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalComputation.g:31:7: ( '+' ) + // InternalComputation.g:31:9: '+' + { + match('+'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__31" + // $ANTLR start "RULE_ID" public final void mRULE_ID() throws RecognitionException { try { int _type = RULE_ID; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:2557:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) - // InternalComputation.g:2557:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalComputation.g:2893:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) + // InternalComputation.g:2893:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* { - // InternalComputation.g:2557:11: ( '^' )? + // InternalComputation.g:2893:11: ( '^' )? int alt1=2; int LA1_0 = input.LA(1); @@ -481,7 +503,7 @@ public class InternalComputationLexer extends Lexer { } switch (alt1) { case 1 : - // InternalComputation.g:2557:11: '^' + // InternalComputation.g:2893:11: '^' { match('^'); @@ -499,7 +521,7 @@ public class InternalComputationLexer extends Lexer { recover(mse); throw mse;} - // InternalComputation.g:2557:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalComputation.g:2893:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* loop2: do { int alt2=2; @@ -548,10 +570,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = RULE_INT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:2559:10: ( ( '0' .. '9' )+ ) - // InternalComputation.g:2559:12: ( '0' .. '9' )+ + // InternalComputation.g:2895:10: ( ( '0' .. '9' )+ ) + // InternalComputation.g:2895:12: ( '0' .. '9' )+ { - // InternalComputation.g:2559:12: ( '0' .. '9' )+ + // InternalComputation.g:2895:12: ( '0' .. '9' )+ int cnt3=0; loop3: do { @@ -565,7 +587,7 @@ public class InternalComputationLexer extends Lexer { switch (alt3) { case 1 : - // InternalComputation.g:2559:13: '0' .. '9' + // InternalComputation.g:2895:13: '0' .. '9' { matchRange('0','9'); @@ -597,10 +619,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = RULE_STRING; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:2561:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) - // InternalComputation.g:2561:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) + // InternalComputation.g:2897:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) + // InternalComputation.g:2897:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) { - // InternalComputation.g:2561:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) + // InternalComputation.g:2897:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) int alt6=2; int LA6_0 = input.LA(1); @@ -618,10 +640,10 @@ public class InternalComputationLexer extends Lexer { } switch (alt6) { case 1 : - // InternalComputation.g:2561:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' + // InternalComputation.g:2897:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' { match('\"'); - // InternalComputation.g:2561:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* + // InternalComputation.g:2897:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* loop4: do { int alt4=3; @@ -637,7 +659,7 @@ public class InternalComputationLexer extends Lexer { switch (alt4) { case 1 : - // InternalComputation.g:2561:21: '\\\\' . + // InternalComputation.g:2897:21: '\\\\' . { match('\\'); matchAny(); @@ -645,7 +667,7 @@ public class InternalComputationLexer extends Lexer { } break; case 2 : - // InternalComputation.g:2561:28: ~ ( ( '\\\\' | '\"' ) ) + // InternalComputation.g:2897:28: ~ ( ( '\\\\' | '\"' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -670,10 +692,10 @@ public class InternalComputationLexer extends Lexer { } break; case 2 : - // InternalComputation.g:2561:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' + // InternalComputation.g:2897:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' { match('\''); - // InternalComputation.g:2561:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* + // InternalComputation.g:2897:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* loop5: do { int alt5=3; @@ -689,7 +711,7 @@ public class InternalComputationLexer extends Lexer { switch (alt5) { case 1 : - // InternalComputation.g:2561:54: '\\\\' . + // InternalComputation.g:2897:54: '\\\\' . { match('\\'); matchAny(); @@ -697,7 +719,7 @@ public class InternalComputationLexer extends Lexer { } break; case 2 : - // InternalComputation.g:2561:61: ~ ( ( '\\\\' | '\\'' ) ) + // InternalComputation.g:2897:61: ~ ( ( '\\\\' | '\\'' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -740,12 +762,12 @@ public class InternalComputationLexer extends Lexer { try { int _type = RULE_ML_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:2563:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) - // InternalComputation.g:2563:19: '/*' ( options {greedy=false; } : . )* '*/' + // InternalComputation.g:2899:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) + // InternalComputation.g:2899:19: '/*' ( options {greedy=false; } : . )* '*/' { match("/*"); - // InternalComputation.g:2563:24: ( options {greedy=false; } : . )* + // InternalComputation.g:2899:24: ( options {greedy=false; } : . )* loop7: do { int alt7=2; @@ -770,7 +792,7 @@ public class InternalComputationLexer extends Lexer { switch (alt7) { case 1 : - // InternalComputation.g:2563:52: . + // InternalComputation.g:2899:52: . { matchAny(); @@ -800,12 +822,12 @@ public class InternalComputationLexer extends Lexer { try { int _type = RULE_SL_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:2565:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) - // InternalComputation.g:2565:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? + // InternalComputation.g:2901:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) + // InternalComputation.g:2901:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? { match("//"); - // InternalComputation.g:2565:24: (~ ( ( '\\n' | '\\r' ) ) )* + // InternalComputation.g:2901:24: (~ ( ( '\\n' | '\\r' ) ) )* loop8: do { int alt8=2; @@ -818,7 +840,7 @@ public class InternalComputationLexer extends Lexer { switch (alt8) { case 1 : - // InternalComputation.g:2565:24: ~ ( ( '\\n' | '\\r' ) ) + // InternalComputation.g:2901:24: ~ ( ( '\\n' | '\\r' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -838,7 +860,7 @@ public class InternalComputationLexer extends Lexer { } } while (true); - // InternalComputation.g:2565:40: ( ( '\\r' )? '\\n' )? + // InternalComputation.g:2901:40: ( ( '\\r' )? '\\n' )? int alt10=2; int LA10_0 = input.LA(1); @@ -847,9 +869,9 @@ public class InternalComputationLexer extends Lexer { } switch (alt10) { case 1 : - // InternalComputation.g:2565:41: ( '\\r' )? '\\n' + // InternalComputation.g:2901:41: ( '\\r' )? '\\n' { - // InternalComputation.g:2565:41: ( '\\r' )? + // InternalComputation.g:2901:41: ( '\\r' )? int alt9=2; int LA9_0 = input.LA(1); @@ -858,7 +880,7 @@ public class InternalComputationLexer extends Lexer { } switch (alt9) { case 1 : - // InternalComputation.g:2565:41: '\\r' + // InternalComputation.g:2901:41: '\\r' { match('\r'); @@ -890,10 +912,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = RULE_WS; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:2567:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) - // InternalComputation.g:2567:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + // InternalComputation.g:2903:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) + // InternalComputation.g:2903:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ { - // InternalComputation.g:2567:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + // InternalComputation.g:2903:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ int cnt11=0; loop11: do { @@ -947,8 +969,8 @@ public class InternalComputationLexer extends Lexer { try { int _type = RULE_ANY_OTHER; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:2569:16: ( . ) - // InternalComputation.g:2569:18: . + // InternalComputation.g:2905:16: ( . ) + // InternalComputation.g:2905:18: . { matchAny(); @@ -963,8 +985,8 @@ public class InternalComputationLexer extends Lexer { // $ANTLR end "RULE_ANY_OTHER" public void mTokens() throws RecognitionException { - // InternalComputation.g:1:8: ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER ) - int alt12=27; + // InternalComputation.g:1:8: ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER ) + int alt12=28; alt12 = dfa12.predict(input); switch (alt12) { case 1 : @@ -1108,49 +1130,56 @@ public class InternalComputationLexer extends Lexer { } break; case 21 : - // InternalComputation.g:1:130: RULE_ID + // InternalComputation.g:1:130: T__31 { - mRULE_ID(); + mT__31(); } break; case 22 : - // InternalComputation.g:1:138: RULE_INT + // InternalComputation.g:1:136: RULE_ID { - mRULE_INT(); + mRULE_ID(); } break; case 23 : - // InternalComputation.g:1:147: RULE_STRING + // InternalComputation.g:1:144: RULE_INT { - mRULE_STRING(); + mRULE_INT(); } break; case 24 : - // InternalComputation.g:1:159: RULE_ML_COMMENT + // InternalComputation.g:1:153: RULE_STRING { - mRULE_ML_COMMENT(); + mRULE_STRING(); } break; case 25 : - // InternalComputation.g:1:175: RULE_SL_COMMENT + // InternalComputation.g:1:165: RULE_ML_COMMENT { - mRULE_SL_COMMENT(); + mRULE_ML_COMMENT(); } break; case 26 : - // InternalComputation.g:1:191: RULE_WS + // InternalComputation.g:1:181: RULE_SL_COMMENT { - mRULE_WS(); + mRULE_SL_COMMENT(); } break; case 27 : - // InternalComputation.g:1:199: RULE_ANY_OTHER + // InternalComputation.g:1:197: RULE_WS + { + mRULE_WS(); + + } + break; + case 28 : + // InternalComputation.g:1:205: RULE_ANY_OTHER { mRULE_ANY_OTHER(); @@ -1164,64 +1193,65 @@ public class InternalComputationLexer extends Lexer { protected DFA12 dfa12 = new DFA12(this); static final String DFA12_eotS = - "\1\uffff\3\34\2\uffff\1\34\1\uffff\2\34\1\uffff\1\34\1\uffff\1\52\1\34\4\uffff\1\32\2\uffff\3\32\2\uffff\1\34\1\uffff\3\34\2\uffff\1\34\1\uffff\2\34\1\74\1\uffff\1\34\2\uffff\1\34\11\uffff\1\77\1\100\5\34\1\uffff\1\34\1\107\2\uffff\6\34\1\uffff\1\116\4\34\1\123\1\uffff\1\34\1\125\2\34\1\uffff\1\34\1\uffff\6\34\1\137\2\34\1\uffff\1\34\1\143\1\34\1\uffff\3\34\1\150\1\uffff"; + "\1\uffff\3\35\2\uffff\1\35\1\uffff\2\35\1\uffff\1\35\1\uffff\1\35\1\uffff\1\55\1\35\3\uffff\1\33\2\uffff\3\33\2\uffff\1\35\1\uffff\3\35\2\uffff\1\35\1\uffff\2\35\1\76\1\uffff\1\35\1\uffff\1\35\2\uffff\1\35\10\uffff\1\102\1\103\5\35\1\uffff\2\35\1\113\2\uffff\7\35\1\uffff\1\123\4\35\1\130\1\131\1\uffff\1\35\1\133\2\35\2\uffff\1\35\1\uffff\6\35\1\145\2\35\1\uffff\1\35\1\151\1\35\1\uffff\3\35\1\156\1\uffff"; static final String DFA12_eofS = - "\151\uffff"; + "\157\uffff"; static final String DFA12_minS = - "\1\0\1\104\1\125\1\141\2\uffff\1\141\1\uffff\1\162\1\160\1\uffff\1\154\1\uffff\1\60\1\141\4\uffff\1\101\2\uffff\2\0\1\52\2\uffff\1\104\1\uffff\1\114\1\162\1\157\2\uffff\1\162\1\uffff\1\145\1\164\1\60\1\uffff\1\157\2\uffff\1\170\11\uffff\2\60\1\141\1\142\1\147\1\161\1\160\1\uffff\1\143\1\60\2\uffff\1\155\1\154\1\145\2\165\1\153\1\uffff\1\60\1\145\1\164\1\145\1\164\1\60\1\uffff\1\155\1\60\1\156\1\163\1\uffff\1\123\1\uffff\1\143\1\120\1\151\1\171\1\145\1\172\1\60\1\162\1\145\1\uffff\1\103\1\60\1\171\1\uffff\1\143\1\154\1\145\1\60\1\uffff"; + "\1\0\1\104\1\125\1\141\2\uffff\1\141\1\uffff\1\162\1\160\1\uffff\1\162\1\uffff\1\154\1\uffff\1\60\1\141\3\uffff\1\101\2\uffff\2\0\1\52\2\uffff\1\104\1\uffff\1\114\1\162\1\157\2\uffff\1\162\1\uffff\1\145\1\164\1\60\1\uffff\1\157\1\uffff\1\157\2\uffff\1\170\10\uffff\2\60\1\141\1\142\1\147\1\161\1\160\1\uffff\1\165\1\143\1\60\2\uffff\1\155\1\154\1\145\2\165\1\160\1\153\1\uffff\1\60\1\145\1\164\1\145\1\164\2\60\1\uffff\1\155\1\60\1\156\1\163\2\uffff\1\123\1\uffff\1\143\1\120\1\151\1\171\1\145\1\172\1\60\1\162\1\145\1\uffff\1\103\1\60\1\171\1\uffff\1\143\1\154\1\145\1\60\1\uffff"; static final String DFA12_maxS = - "\1\uffff\1\104\1\125\1\162\2\uffff\1\141\1\uffff\1\162\1\165\1\uffff\1\154\1\uffff\1\172\1\141\4\uffff\1\172\2\uffff\2\uffff\1\57\2\uffff\1\104\1\uffff\1\114\1\162\1\157\2\uffff\1\162\1\uffff\1\145\1\164\1\172\1\uffff\1\157\2\uffff\1\170\11\uffff\2\172\1\141\1\142\1\147\1\161\1\160\1\uffff\1\143\1\172\2\uffff\1\155\1\154\1\145\2\165\1\153\1\uffff\1\172\1\145\1\164\1\145\1\164\1\172\1\uffff\1\155\1\172\1\156\1\163\1\uffff\1\123\1\uffff\1\143\1\120\1\151\1\171\1\145\2\172\1\162\1\145\1\uffff\1\103\1\172\1\171\1\uffff\1\143\1\154\1\145\1\172\1\uffff"; + "\1\uffff\1\104\1\125\1\162\2\uffff\1\141\1\uffff\1\162\1\165\1\uffff\1\162\1\uffff\1\154\1\uffff\1\172\1\141\3\uffff\1\172\2\uffff\2\uffff\1\57\2\uffff\1\104\1\uffff\1\114\1\162\1\157\2\uffff\1\162\1\uffff\1\145\1\164\1\172\1\uffff\1\157\1\uffff\1\157\2\uffff\1\170\10\uffff\2\172\1\141\1\142\1\147\1\161\1\160\1\uffff\1\165\1\143\1\172\2\uffff\1\155\1\154\1\145\2\165\1\160\1\153\1\uffff\1\172\1\145\1\164\1\145\1\164\2\172\1\uffff\1\155\1\172\1\156\1\163\2\uffff\1\123\1\uffff\1\143\1\120\1\151\1\171\1\145\2\172\1\162\1\145\1\uffff\1\103\1\172\1\171\1\uffff\1\143\1\154\1\145\1\172\1\uffff"; static final String DFA12_acceptS = - "\4\uffff\1\4\1\5\1\uffff\1\7\2\uffff\1\13\1\uffff\1\15\2\uffff\1\21\1\22\1\23\1\24\1\uffff\1\25\1\26\3\uffff\1\32\1\33\1\uffff\1\25\3\uffff\1\4\1\5\1\uffff\1\7\3\uffff\1\13\1\uffff\1\15\1\17\1\uffff\1\21\1\22\1\23\1\24\1\26\1\27\1\30\1\31\1\32\7\uffff\1\16\2\uffff\1\1\1\2\6\uffff\1\20\6\uffff\1\3\4\uffff\1\14\1\uffff\1\6\11\uffff\1\10\3\uffff\1\12\4\uffff\1\11"; + "\4\uffff\1\4\1\5\1\uffff\1\7\2\uffff\1\13\1\uffff\1\15\1\uffff\1\17\2\uffff\1\23\1\24\1\25\1\uffff\1\26\1\27\3\uffff\1\33\1\34\1\uffff\1\26\3\uffff\1\4\1\5\1\uffff\1\7\3\uffff\1\13\1\uffff\1\15\1\uffff\1\17\1\21\1\uffff\1\23\1\24\1\25\1\27\1\30\1\31\1\32\1\33\7\uffff\1\20\3\uffff\1\1\1\2\7\uffff\1\22\7\uffff\1\3\4\uffff\1\14\1\16\1\uffff\1\6\11\uffff\1\10\3\uffff\1\12\4\uffff\1\11"; static final String DFA12_specialS = - "\1\2\25\uffff\1\1\1\0\121\uffff}>"; + "\1\1\26\uffff\1\0\1\2\126\uffff}>"; static final String[] DFA12_transitionS = { - "\11\32\2\31\2\32\1\31\22\32\1\31\1\32\1\26\4\32\1\27\1\17\1\20\1\32\1\22\1\21\2\32\1\30\12\25\1\14\1\5\1\32\1\4\3\32\1\1\13\24\1\2\15\24\3\32\1\23\1\24\1\32\1\24\1\13\3\24\1\10\6\24\1\16\1\24\1\11\1\3\3\24\1\6\3\24\1\15\2\24\1\7\1\32\1\12\uff82\32", - "\1\33", - "\1\35", - "\1\36\20\uffff\1\37", + "\11\33\2\32\2\33\1\32\22\33\1\32\1\33\1\27\4\33\1\30\1\21\1\22\1\33\1\23\1\14\2\33\1\31\12\26\1\16\1\5\1\33\1\4\3\33\1\1\13\25\1\2\15\25\3\33\1\24\1\25\1\33\1\25\1\15\3\25\1\10\1\13\5\25\1\20\1\25\1\11\1\3\3\25\1\6\3\25\1\17\2\25\1\7\1\33\1\12\uff82\33", + "\1\34", + "\1\36", + "\1\37\20\uffff\1\40", "", "", - "\1\42", + "\1\43", "", - "\1\44", - "\1\46\4\uffff\1\45", + "\1\45", + "\1\47\4\uffff\1\46", "", - "\1\50", + "\1\51", "", - "\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", "\1\53", "", + "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", + "\1\56", "", "", "", - "\32\34\4\uffff\1\34\1\uffff\32\34", - "", + "\32\35\4\uffff\1\35\1\uffff\32\35", "", - "\0\61", - "\0\61", - "\1\62\4\uffff\1\63", "", + "\0\63", + "\0\63", + "\1\64\4\uffff\1\65", "", - "\1\65", "", - "\1\66", "\1\67", - "\1\70", - "", "", + "\1\70", "\1\71", - "", "\1\72", + "", + "", "\1\73", - "\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", "", + "\1\74", "\1\75", + "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", "", + "\1\77", "", - "\1\76", + "\1\100", "", "", + "\1\101", "", "", "", @@ -1229,57 +1259,62 @@ public class InternalComputationLexer extends Lexer { "", "", "", - "\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", - "\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", - "\1\101", - "\1\102", - "\1\103", + "", + "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", + "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", "\1\104", "\1\105", - "", "\1\106", - "\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", - "", - "", + "\1\107", "\1\110", + "", "\1\111", "\1\112", - "\1\113", + "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", + "", + "", "\1\114", "\1\115", - "", - "\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "\1\116", "\1\117", "\1\120", "\1\121", "\1\122", - "\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", "", + "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", "\1\124", - "\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "\1\125", "\1\126", "\1\127", + "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", + "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", "", - "\1\130", - "", - "\1\131", "\1\132", - "\1\133", + "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", "\1\134", "\1\135", + "", + "", "\1\136", - "\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "", + "\1\137", "\1\140", "\1\141", - "", "\1\142", - "\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "\1\143", "\1\144", - "", - "\1\145", + "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", "\1\146", "\1\147", - "\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "", + "\1\150", + "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", + "\1\152", + "", + "\1\153", + "\1\154", + "\1\155", + "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", "" }; @@ -1313,7 +1348,7 @@ public class InternalComputationLexer extends Lexer { this.transition = DFA12_transition; } public String getDescription() { - return "1:1: Tokens : ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );"; + return "1:1: Tokens : ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );"; } public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { IntStream input = _input; @@ -1323,23 +1358,13 @@ public class InternalComputationLexer extends Lexer { int LA12_23 = input.LA(1); s = -1; - if ( ((LA12_23>='\u0000' && LA12_23<='\uFFFF')) ) {s = 49;} + if ( ((LA12_23>='\u0000' && LA12_23<='\uFFFF')) ) {s = 51;} - else s = 26; + else s = 27; if ( s>=0 ) return s; break; case 1 : - int LA12_22 = input.LA(1); - - s = -1; - if ( ((LA12_22>='\u0000' && LA12_22<='\uFFFF')) ) {s = 49;} - - else s = 26; - - if ( s>=0 ) return s; - break; - case 2 : int LA12_0 = input.LA(1); s = -1; @@ -1363,37 +1388,49 @@ public class InternalComputationLexer extends Lexer { else if ( (LA12_0=='}') ) {s = 10;} - else if ( (LA12_0=='b') ) {s = 11;} + else if ( (LA12_0=='g') ) {s = 11;} + + else if ( (LA12_0==',') ) {s = 12;} + + else if ( (LA12_0=='b') ) {s = 13;} + + else if ( (LA12_0==':') ) {s = 14;} - else if ( (LA12_0==':') ) {s = 12;} + else if ( (LA12_0=='x') ) {s = 15;} - else if ( (LA12_0=='x') ) {s = 13;} + else if ( (LA12_0=='m') ) {s = 16;} - else if ( (LA12_0=='m') ) {s = 14;} + else if ( (LA12_0=='(') ) {s = 17;} - else if ( (LA12_0=='(') ) {s = 15;} + else if ( (LA12_0==')') ) {s = 18;} - else if ( (LA12_0==')') ) {s = 16;} + else if ( (LA12_0=='+') ) {s = 19;} - else if ( (LA12_0==',') ) {s = 17;} + else if ( (LA12_0=='^') ) {s = 20;} - else if ( (LA12_0=='+') ) {s = 18;} + else if ( ((LA12_0>='B' && LA12_0<='L')||(LA12_0>='N' && LA12_0<='Z')||LA12_0=='_'||LA12_0=='a'||(LA12_0>='c' && LA12_0<='e')||(LA12_0>='h' && LA12_0<='l')||LA12_0=='n'||(LA12_0>='q' && LA12_0<='s')||(LA12_0>='u' && LA12_0<='w')||(LA12_0>='y' && LA12_0<='z')) ) {s = 21;} - else if ( (LA12_0=='^') ) {s = 19;} + else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 22;} - else if ( ((LA12_0>='B' && LA12_0<='L')||(LA12_0>='N' && LA12_0<='Z')||LA12_0=='_'||LA12_0=='a'||(LA12_0>='c' && LA12_0<='e')||(LA12_0>='g' && LA12_0<='l')||LA12_0=='n'||(LA12_0>='q' && LA12_0<='s')||(LA12_0>='u' && LA12_0<='w')||(LA12_0>='y' && LA12_0<='z')) ) {s = 20;} + else if ( (LA12_0=='\"') ) {s = 23;} - else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 21;} + else if ( (LA12_0=='\'') ) {s = 24;} - else if ( (LA12_0=='\"') ) {s = 22;} + else if ( (LA12_0=='/') ) {s = 25;} - else if ( (LA12_0=='\'') ) {s = 23;} + else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 26;} - else if ( (LA12_0=='/') ) {s = 24;} + else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||LA12_0=='*'||(LA12_0>='-' && LA12_0<='.')||LA12_0=='<'||(LA12_0>='>' && LA12_0<='@')||(LA12_0>='[' && LA12_0<=']')||LA12_0=='`'||LA12_0=='|'||(LA12_0>='~' && LA12_0<='\uFFFF')) ) {s = 27;} - else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 25;} + if ( s>=0 ) return s; + break; + case 2 : + int LA12_24 = input.LA(1); + + s = -1; + if ( ((LA12_24>='\u0000' && LA12_24<='\uFFFF')) ) {s = 51;} - else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||LA12_0=='*'||(LA12_0>='-' && LA12_0<='.')||LA12_0=='<'||(LA12_0>='>' && LA12_0<='@')||(LA12_0>='[' && LA12_0<=']')||LA12_0=='`'||LA12_0=='|'||(LA12_0>='~' && LA12_0<='\uFFFF')) ) {s = 26;} + else s = 27; if ( s>=0 ) return s; break; diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputationParser.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputationParser.java index 7bde495e034bbcd356dd8e7e723994c0f7d52182..39e5129d47de37e8bf589cebf926b79851244af6 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputationParser.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ide/src-gen/fr/irisa/cairn/gecos/typeexploration/ide/contentassist/antlr/internal/InternalComputationParser.java @@ -22,7 +22,7 @@ import java.util.ArrayList; @SuppressWarnings("all") public class InternalComputationParser extends AbstractInternalContentAssistParser { public static final String[] tokenNames = new String[] { - "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_INT", "RULE_STRING", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'ADD'", "'MUL'", "'param'", "'='", "';'", "'target'", "'{'", "'frequency'", "'outputsPerCycle'", "'problemSize'", "'}'", "'block'", "':'", "'op'", "'x'", "'max'", "'('", "')'", "','", "'+'" + "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_INT", "RULE_STRING", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'ADD'", "'MUL'", "'param'", "'='", "';'", "'target'", "'{'", "'frequency'", "'outputsPerCycle'", "'problemSize'", "'}'", "'group'", "','", "'block'", "':'", "'op'", "'x'", "'max'", "'('", "')'", "'+'" }; public static final int RULE_STRING=6; public static final int RULE_SL_COMMENT=8; @@ -37,6 +37,7 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars public static final int T__14=14; public static final int EOF=-1; public static final int T__30=30; + public static final int T__31=31; public static final int RULE_ID=4; public static final int RULE_WS=9; public static final int RULE_ANY_OTHER=10; @@ -319,12 +320,89 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR end "ruleHWTargetDesign" + // $ANTLR start "entryRuleBlockGroup" + // InternalComputation.g:128:1: entryRuleBlockGroup : ruleBlockGroup EOF ; + public final void entryRuleBlockGroup() throws RecognitionException { + try { + // InternalComputation.g:129:1: ( ruleBlockGroup EOF ) + // InternalComputation.g:130:1: ruleBlockGroup EOF + { + before(grammarAccess.getBlockGroupRule()); + pushFollow(FOLLOW_1); + ruleBlockGroup(); + + state._fsp--; + + after(grammarAccess.getBlockGroupRule()); + match(input,EOF,FOLLOW_2); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + } + return ; + } + // $ANTLR end "entryRuleBlockGroup" + + + // $ANTLR start "ruleBlockGroup" + // InternalComputation.g:137:1: ruleBlockGroup : ( ( rule__BlockGroup__Group__0 ) ) ; + public final void ruleBlockGroup() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:141:2: ( ( ( rule__BlockGroup__Group__0 ) ) ) + // InternalComputation.g:142:2: ( ( rule__BlockGroup__Group__0 ) ) + { + // InternalComputation.g:142:2: ( ( rule__BlockGroup__Group__0 ) ) + // InternalComputation.g:143:3: ( rule__BlockGroup__Group__0 ) + { + before(grammarAccess.getBlockGroupAccess().getGroup()); + // InternalComputation.g:144:3: ( rule__BlockGroup__Group__0 ) + // InternalComputation.g:144:4: rule__BlockGroup__Group__0 + { + pushFollow(FOLLOW_2); + rule__BlockGroup__Group__0(); + + state._fsp--; + + + } + + after(grammarAccess.getBlockGroupAccess().getGroup()); + + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "ruleBlockGroup" + + // $ANTLR start "entryRuleComputationBlock" - // InternalComputation.g:128:1: entryRuleComputationBlock : ruleComputationBlock EOF ; + // InternalComputation.g:153:1: entryRuleComputationBlock : ruleComputationBlock EOF ; public final void entryRuleComputationBlock() throws RecognitionException { try { - // InternalComputation.g:129:1: ( ruleComputationBlock EOF ) - // InternalComputation.g:130:1: ruleComputationBlock EOF + // InternalComputation.g:154:1: ( ruleComputationBlock EOF ) + // InternalComputation.g:155:1: ruleComputationBlock EOF { before(grammarAccess.getComputationBlockRule()); pushFollow(FOLLOW_1); @@ -350,21 +428,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "ruleComputationBlock" - // InternalComputation.g:137:1: ruleComputationBlock : ( ( rule__ComputationBlock__Group__0 ) ) ; + // InternalComputation.g:162:1: ruleComputationBlock : ( ( rule__ComputationBlock__Group__0 ) ) ; public final void ruleComputationBlock() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:141:2: ( ( ( rule__ComputationBlock__Group__0 ) ) ) - // InternalComputation.g:142:2: ( ( rule__ComputationBlock__Group__0 ) ) + // InternalComputation.g:166:2: ( ( ( rule__ComputationBlock__Group__0 ) ) ) + // InternalComputation.g:167:2: ( ( rule__ComputationBlock__Group__0 ) ) { - // InternalComputation.g:142:2: ( ( rule__ComputationBlock__Group__0 ) ) - // InternalComputation.g:143:3: ( rule__ComputationBlock__Group__0 ) + // InternalComputation.g:167:2: ( ( rule__ComputationBlock__Group__0 ) ) + // InternalComputation.g:168:3: ( rule__ComputationBlock__Group__0 ) { before(grammarAccess.getComputationBlockAccess().getGroup()); - // InternalComputation.g:144:3: ( rule__ComputationBlock__Group__0 ) - // InternalComputation.g:144:4: rule__ComputationBlock__Group__0 + // InternalComputation.g:169:3: ( rule__ComputationBlock__Group__0 ) + // InternalComputation.g:169:4: rule__ComputationBlock__Group__0 { pushFollow(FOLLOW_2); rule__ComputationBlock__Group__0(); @@ -397,11 +475,11 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "entryRuleOP" - // InternalComputation.g:153:1: entryRuleOP : ruleOP EOF ; + // InternalComputation.g:178:1: entryRuleOP : ruleOP EOF ; public final void entryRuleOP() throws RecognitionException { try { - // InternalComputation.g:154:1: ( ruleOP EOF ) - // InternalComputation.g:155:1: ruleOP EOF + // InternalComputation.g:179:1: ( ruleOP EOF ) + // InternalComputation.g:180:1: ruleOP EOF { before(grammarAccess.getOPRule()); pushFollow(FOLLOW_1); @@ -427,21 +505,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "ruleOP" - // InternalComputation.g:162:1: ruleOP : ( ( rule__OP__Alternatives ) ) ; + // InternalComputation.g:187:1: ruleOP : ( ( rule__OP__Alternatives ) ) ; public final void ruleOP() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:166:2: ( ( ( rule__OP__Alternatives ) ) ) - // InternalComputation.g:167:2: ( ( rule__OP__Alternatives ) ) + // InternalComputation.g:191:2: ( ( ( rule__OP__Alternatives ) ) ) + // InternalComputation.g:192:2: ( ( rule__OP__Alternatives ) ) { - // InternalComputation.g:167:2: ( ( rule__OP__Alternatives ) ) - // InternalComputation.g:168:3: ( rule__OP__Alternatives ) + // InternalComputation.g:192:2: ( ( rule__OP__Alternatives ) ) + // InternalComputation.g:193:3: ( rule__OP__Alternatives ) { before(grammarAccess.getOPAccess().getAlternatives()); - // InternalComputation.g:169:3: ( rule__OP__Alternatives ) - // InternalComputation.g:169:4: rule__OP__Alternatives + // InternalComputation.g:194:3: ( rule__OP__Alternatives ) + // InternalComputation.g:194:4: rule__OP__Alternatives { pushFollow(FOLLOW_2); rule__OP__Alternatives(); @@ -474,11 +552,11 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "entryRuleOperation" - // InternalComputation.g:178:1: entryRuleOperation : ruleOperation EOF ; + // InternalComputation.g:203:1: entryRuleOperation : ruleOperation EOF ; public final void entryRuleOperation() throws RecognitionException { try { - // InternalComputation.g:179:1: ( ruleOperation EOF ) - // InternalComputation.g:180:1: ruleOperation EOF + // InternalComputation.g:204:1: ( ruleOperation EOF ) + // InternalComputation.g:205:1: ruleOperation EOF { before(grammarAccess.getOperationRule()); pushFollow(FOLLOW_1); @@ -504,21 +582,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "ruleOperation" - // InternalComputation.g:187:1: ruleOperation : ( ( rule__Operation__Group__0 ) ) ; + // InternalComputation.g:212:1: ruleOperation : ( ( rule__Operation__Group__0 ) ) ; public final void ruleOperation() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:191:2: ( ( ( rule__Operation__Group__0 ) ) ) - // InternalComputation.g:192:2: ( ( rule__Operation__Group__0 ) ) + // InternalComputation.g:216:2: ( ( ( rule__Operation__Group__0 ) ) ) + // InternalComputation.g:217:2: ( ( rule__Operation__Group__0 ) ) { - // InternalComputation.g:192:2: ( ( rule__Operation__Group__0 ) ) - // InternalComputation.g:193:3: ( rule__Operation__Group__0 ) + // InternalComputation.g:217:2: ( ( rule__Operation__Group__0 ) ) + // InternalComputation.g:218:3: ( rule__Operation__Group__0 ) { before(grammarAccess.getOperationAccess().getGroup()); - // InternalComputation.g:194:3: ( rule__Operation__Group__0 ) - // InternalComputation.g:194:4: rule__Operation__Group__0 + // InternalComputation.g:219:3: ( rule__Operation__Group__0 ) + // InternalComputation.g:219:4: rule__Operation__Group__0 { pushFollow(FOLLOW_2); rule__Operation__Group__0(); @@ -551,11 +629,11 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "entryRuleOperandExpression" - // InternalComputation.g:203:1: entryRuleOperandExpression : ruleOperandExpression EOF ; + // InternalComputation.g:228:1: entryRuleOperandExpression : ruleOperandExpression EOF ; public final void entryRuleOperandExpression() throws RecognitionException { try { - // InternalComputation.g:204:1: ( ruleOperandExpression EOF ) - // InternalComputation.g:205:1: ruleOperandExpression EOF + // InternalComputation.g:229:1: ( ruleOperandExpression EOF ) + // InternalComputation.g:230:1: ruleOperandExpression EOF { before(grammarAccess.getOperandExpressionRule()); pushFollow(FOLLOW_1); @@ -581,21 +659,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "ruleOperandExpression" - // InternalComputation.g:212:1: ruleOperandExpression : ( ( rule__OperandExpression__Alternatives ) ) ; + // InternalComputation.g:237:1: ruleOperandExpression : ( ( rule__OperandExpression__Alternatives ) ) ; public final void ruleOperandExpression() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:216:2: ( ( ( rule__OperandExpression__Alternatives ) ) ) - // InternalComputation.g:217:2: ( ( rule__OperandExpression__Alternatives ) ) + // InternalComputation.g:241:2: ( ( ( rule__OperandExpression__Alternatives ) ) ) + // InternalComputation.g:242:2: ( ( rule__OperandExpression__Alternatives ) ) { - // InternalComputation.g:217:2: ( ( rule__OperandExpression__Alternatives ) ) - // InternalComputation.g:218:3: ( rule__OperandExpression__Alternatives ) + // InternalComputation.g:242:2: ( ( rule__OperandExpression__Alternatives ) ) + // InternalComputation.g:243:3: ( rule__OperandExpression__Alternatives ) { before(grammarAccess.getOperandExpressionAccess().getAlternatives()); - // InternalComputation.g:219:3: ( rule__OperandExpression__Alternatives ) - // InternalComputation.g:219:4: rule__OperandExpression__Alternatives + // InternalComputation.g:244:3: ( rule__OperandExpression__Alternatives ) + // InternalComputation.g:244:4: rule__OperandExpression__Alternatives { pushFollow(FOLLOW_2); rule__OperandExpression__Alternatives(); @@ -628,11 +706,11 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "entryRuleMaxExpression" - // InternalComputation.g:228:1: entryRuleMaxExpression : ruleMaxExpression EOF ; + // InternalComputation.g:253:1: entryRuleMaxExpression : ruleMaxExpression EOF ; public final void entryRuleMaxExpression() throws RecognitionException { try { - // InternalComputation.g:229:1: ( ruleMaxExpression EOF ) - // InternalComputation.g:230:1: ruleMaxExpression EOF + // InternalComputation.g:254:1: ( ruleMaxExpression EOF ) + // InternalComputation.g:255:1: ruleMaxExpression EOF { before(grammarAccess.getMaxExpressionRule()); pushFollow(FOLLOW_1); @@ -658,21 +736,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "ruleMaxExpression" - // InternalComputation.g:237:1: ruleMaxExpression : ( ( rule__MaxExpression__Group__0 ) ) ; + // InternalComputation.g:262:1: ruleMaxExpression : ( ( rule__MaxExpression__Group__0 ) ) ; public final void ruleMaxExpression() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:241:2: ( ( ( rule__MaxExpression__Group__0 ) ) ) - // InternalComputation.g:242:2: ( ( rule__MaxExpression__Group__0 ) ) + // InternalComputation.g:266:2: ( ( ( rule__MaxExpression__Group__0 ) ) ) + // InternalComputation.g:267:2: ( ( rule__MaxExpression__Group__0 ) ) { - // InternalComputation.g:242:2: ( ( rule__MaxExpression__Group__0 ) ) - // InternalComputation.g:243:3: ( rule__MaxExpression__Group__0 ) + // InternalComputation.g:267:2: ( ( rule__MaxExpression__Group__0 ) ) + // InternalComputation.g:268:3: ( rule__MaxExpression__Group__0 ) { before(grammarAccess.getMaxExpressionAccess().getGroup()); - // InternalComputation.g:244:3: ( rule__MaxExpression__Group__0 ) - // InternalComputation.g:244:4: rule__MaxExpression__Group__0 + // InternalComputation.g:269:3: ( rule__MaxExpression__Group__0 ) + // InternalComputation.g:269:4: rule__MaxExpression__Group__0 { pushFollow(FOLLOW_2); rule__MaxExpression__Group__0(); @@ -705,11 +783,11 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "entryRuleTerminalOperandExpression" - // InternalComputation.g:253:1: entryRuleTerminalOperandExpression : ruleTerminalOperandExpression EOF ; + // InternalComputation.g:278:1: entryRuleTerminalOperandExpression : ruleTerminalOperandExpression EOF ; public final void entryRuleTerminalOperandExpression() throws RecognitionException { try { - // InternalComputation.g:254:1: ( ruleTerminalOperandExpression EOF ) - // InternalComputation.g:255:1: ruleTerminalOperandExpression EOF + // InternalComputation.g:279:1: ( ruleTerminalOperandExpression EOF ) + // InternalComputation.g:280:1: ruleTerminalOperandExpression EOF { before(grammarAccess.getTerminalOperandExpressionRule()); pushFollow(FOLLOW_1); @@ -735,21 +813,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "ruleTerminalOperandExpression" - // InternalComputation.g:262:1: ruleTerminalOperandExpression : ( ( rule__TerminalOperandExpression__Alternatives ) ) ; + // InternalComputation.g:287:1: ruleTerminalOperandExpression : ( ( rule__TerminalOperandExpression__Alternatives ) ) ; public final void ruleTerminalOperandExpression() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:266:2: ( ( ( rule__TerminalOperandExpression__Alternatives ) ) ) - // InternalComputation.g:267:2: ( ( rule__TerminalOperandExpression__Alternatives ) ) + // InternalComputation.g:291:2: ( ( ( rule__TerminalOperandExpression__Alternatives ) ) ) + // InternalComputation.g:292:2: ( ( rule__TerminalOperandExpression__Alternatives ) ) { - // InternalComputation.g:267:2: ( ( rule__TerminalOperandExpression__Alternatives ) ) - // InternalComputation.g:268:3: ( rule__TerminalOperandExpression__Alternatives ) + // InternalComputation.g:292:2: ( ( rule__TerminalOperandExpression__Alternatives ) ) + // InternalComputation.g:293:3: ( rule__TerminalOperandExpression__Alternatives ) { before(grammarAccess.getTerminalOperandExpressionAccess().getAlternatives()); - // InternalComputation.g:269:3: ( rule__TerminalOperandExpression__Alternatives ) - // InternalComputation.g:269:4: rule__TerminalOperandExpression__Alternatives + // InternalComputation.g:294:3: ( rule__TerminalOperandExpression__Alternatives ) + // InternalComputation.g:294:4: rule__TerminalOperandExpression__Alternatives { pushFollow(FOLLOW_2); rule__TerminalOperandExpression__Alternatives(); @@ -782,11 +860,11 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "entryRuleAddExpression" - // InternalComputation.g:278:1: entryRuleAddExpression : ruleAddExpression EOF ; + // InternalComputation.g:303:1: entryRuleAddExpression : ruleAddExpression EOF ; public final void entryRuleAddExpression() throws RecognitionException { try { - // InternalComputation.g:279:1: ( ruleAddExpression EOF ) - // InternalComputation.g:280:1: ruleAddExpression EOF + // InternalComputation.g:304:1: ( ruleAddExpression EOF ) + // InternalComputation.g:305:1: ruleAddExpression EOF { before(grammarAccess.getAddExpressionRule()); pushFollow(FOLLOW_1); @@ -812,21 +890,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "ruleAddExpression" - // InternalComputation.g:287:1: ruleAddExpression : ( ( rule__AddExpression__Group__0 ) ) ; + // InternalComputation.g:312:1: ruleAddExpression : ( ( rule__AddExpression__Group__0 ) ) ; public final void ruleAddExpression() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:291:2: ( ( ( rule__AddExpression__Group__0 ) ) ) - // InternalComputation.g:292:2: ( ( rule__AddExpression__Group__0 ) ) + // InternalComputation.g:316:2: ( ( ( rule__AddExpression__Group__0 ) ) ) + // InternalComputation.g:317:2: ( ( rule__AddExpression__Group__0 ) ) { - // InternalComputation.g:292:2: ( ( rule__AddExpression__Group__0 ) ) - // InternalComputation.g:293:3: ( rule__AddExpression__Group__0 ) + // InternalComputation.g:317:2: ( ( rule__AddExpression__Group__0 ) ) + // InternalComputation.g:318:3: ( rule__AddExpression__Group__0 ) { before(grammarAccess.getAddExpressionAccess().getGroup()); - // InternalComputation.g:294:3: ( rule__AddExpression__Group__0 ) - // InternalComputation.g:294:4: rule__AddExpression__Group__0 + // InternalComputation.g:319:3: ( rule__AddExpression__Group__0 ) + // InternalComputation.g:319:4: rule__AddExpression__Group__0 { pushFollow(FOLLOW_2); rule__AddExpression__Group__0(); @@ -859,11 +937,11 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "entryRuleOperandTerm" - // InternalComputation.g:303:1: entryRuleOperandTerm : ruleOperandTerm EOF ; + // InternalComputation.g:328:1: entryRuleOperandTerm : ruleOperandTerm EOF ; public final void entryRuleOperandTerm() throws RecognitionException { try { - // InternalComputation.g:304:1: ( ruleOperandTerm EOF ) - // InternalComputation.g:305:1: ruleOperandTerm EOF + // InternalComputation.g:329:1: ( ruleOperandTerm EOF ) + // InternalComputation.g:330:1: ruleOperandTerm EOF { before(grammarAccess.getOperandTermRule()); pushFollow(FOLLOW_1); @@ -889,21 +967,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "ruleOperandTerm" - // InternalComputation.g:312:1: ruleOperandTerm : ( ( rule__OperandTerm__Group__0 ) ) ; + // InternalComputation.g:337:1: ruleOperandTerm : ( ( rule__OperandTerm__Group__0 ) ) ; public final void ruleOperandTerm() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:316:2: ( ( ( rule__OperandTerm__Group__0 ) ) ) - // InternalComputation.g:317:2: ( ( rule__OperandTerm__Group__0 ) ) + // InternalComputation.g:341:2: ( ( ( rule__OperandTerm__Group__0 ) ) ) + // InternalComputation.g:342:2: ( ( rule__OperandTerm__Group__0 ) ) { - // InternalComputation.g:317:2: ( ( rule__OperandTerm__Group__0 ) ) - // InternalComputation.g:318:3: ( rule__OperandTerm__Group__0 ) + // InternalComputation.g:342:2: ( ( rule__OperandTerm__Group__0 ) ) + // InternalComputation.g:343:3: ( rule__OperandTerm__Group__0 ) { before(grammarAccess.getOperandTermAccess().getGroup()); - // InternalComputation.g:319:3: ( rule__OperandTerm__Group__0 ) - // InternalComputation.g:319:4: rule__OperandTerm__Group__0 + // InternalComputation.g:344:3: ( rule__OperandTerm__Group__0 ) + // InternalComputation.g:344:4: rule__OperandTerm__Group__0 { pushFollow(FOLLOW_2); rule__OperandTerm__Group__0(); @@ -936,11 +1014,11 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "entryRuleSummationExpression" - // InternalComputation.g:328:1: entryRuleSummationExpression : ruleSummationExpression EOF ; + // InternalComputation.g:353:1: entryRuleSummationExpression : ruleSummationExpression EOF ; public final void entryRuleSummationExpression() throws RecognitionException { try { - // InternalComputation.g:329:1: ( ruleSummationExpression EOF ) - // InternalComputation.g:330:1: ruleSummationExpression EOF + // InternalComputation.g:354:1: ( ruleSummationExpression EOF ) + // InternalComputation.g:355:1: ruleSummationExpression EOF { before(grammarAccess.getSummationExpressionRule()); pushFollow(FOLLOW_1); @@ -966,21 +1044,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "ruleSummationExpression" - // InternalComputation.g:337:1: ruleSummationExpression : ( ( rule__SummationExpression__Alternatives ) ) ; + // InternalComputation.g:362:1: ruleSummationExpression : ( ( rule__SummationExpression__Alternatives ) ) ; public final void ruleSummationExpression() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:341:2: ( ( ( rule__SummationExpression__Alternatives ) ) ) - // InternalComputation.g:342:2: ( ( rule__SummationExpression__Alternatives ) ) + // InternalComputation.g:366:2: ( ( ( rule__SummationExpression__Alternatives ) ) ) + // InternalComputation.g:367:2: ( ( rule__SummationExpression__Alternatives ) ) { - // InternalComputation.g:342:2: ( ( rule__SummationExpression__Alternatives ) ) - // InternalComputation.g:343:3: ( rule__SummationExpression__Alternatives ) + // InternalComputation.g:367:2: ( ( rule__SummationExpression__Alternatives ) ) + // InternalComputation.g:368:3: ( rule__SummationExpression__Alternatives ) { before(grammarAccess.getSummationExpressionAccess().getAlternatives()); - // InternalComputation.g:344:3: ( rule__SummationExpression__Alternatives ) - // InternalComputation.g:344:4: rule__SummationExpression__Alternatives + // InternalComputation.g:369:3: ( rule__SummationExpression__Alternatives ) + // InternalComputation.g:369:4: rule__SummationExpression__Alternatives { pushFollow(FOLLOW_2); rule__SummationExpression__Alternatives(); @@ -1013,11 +1091,11 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "entryRuleProductExpression" - // InternalComputation.g:353:1: entryRuleProductExpression : ruleProductExpression EOF ; + // InternalComputation.g:378:1: entryRuleProductExpression : ruleProductExpression EOF ; public final void entryRuleProductExpression() throws RecognitionException { try { - // InternalComputation.g:354:1: ( ruleProductExpression EOF ) - // InternalComputation.g:355:1: ruleProductExpression EOF + // InternalComputation.g:379:1: ( ruleProductExpression EOF ) + // InternalComputation.g:380:1: ruleProductExpression EOF { before(grammarAccess.getProductExpressionRule()); pushFollow(FOLLOW_1); @@ -1043,21 +1121,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "ruleProductExpression" - // InternalComputation.g:362:1: ruleProductExpression : ( ( rule__ProductExpression__Group__0 ) ) ; + // InternalComputation.g:387:1: ruleProductExpression : ( ( rule__ProductExpression__Group__0 ) ) ; public final void ruleProductExpression() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:366:2: ( ( ( rule__ProductExpression__Group__0 ) ) ) - // InternalComputation.g:367:2: ( ( rule__ProductExpression__Group__0 ) ) + // InternalComputation.g:391:2: ( ( ( rule__ProductExpression__Group__0 ) ) ) + // InternalComputation.g:392:2: ( ( rule__ProductExpression__Group__0 ) ) { - // InternalComputation.g:367:2: ( ( rule__ProductExpression__Group__0 ) ) - // InternalComputation.g:368:3: ( rule__ProductExpression__Group__0 ) + // InternalComputation.g:392:2: ( ( rule__ProductExpression__Group__0 ) ) + // InternalComputation.g:393:3: ( rule__ProductExpression__Group__0 ) { before(grammarAccess.getProductExpressionAccess().getGroup()); - // InternalComputation.g:369:3: ( rule__ProductExpression__Group__0 ) - // InternalComputation.g:369:4: rule__ProductExpression__Group__0 + // InternalComputation.g:394:3: ( rule__ProductExpression__Group__0 ) + // InternalComputation.g:394:4: rule__ProductExpression__Group__0 { pushFollow(FOLLOW_2); rule__ProductExpression__Group__0(); @@ -1090,13 +1168,13 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__OP__Alternatives" - // InternalComputation.g:377:1: rule__OP__Alternatives : ( ( 'ADD' ) | ( 'MUL' ) ); + // InternalComputation.g:402:1: rule__OP__Alternatives : ( ( 'ADD' ) | ( 'MUL' ) ); public final void rule__OP__Alternatives() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:381:1: ( ( 'ADD' ) | ( 'MUL' ) ) + // InternalComputation.g:406:1: ( ( 'ADD' ) | ( 'MUL' ) ) int alt1=2; int LA1_0 = input.LA(1); @@ -1114,10 +1192,10 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } switch (alt1) { case 1 : - // InternalComputation.g:382:2: ( 'ADD' ) + // InternalComputation.g:407:2: ( 'ADD' ) { - // InternalComputation.g:382:2: ( 'ADD' ) - // InternalComputation.g:383:3: 'ADD' + // InternalComputation.g:407:2: ( 'ADD' ) + // InternalComputation.g:408:3: 'ADD' { before(grammarAccess.getOPAccess().getADDKeyword_0()); match(input,11,FOLLOW_2); @@ -1129,10 +1207,10 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } break; case 2 : - // InternalComputation.g:388:2: ( 'MUL' ) + // InternalComputation.g:413:2: ( 'MUL' ) { - // InternalComputation.g:388:2: ( 'MUL' ) - // InternalComputation.g:389:3: 'MUL' + // InternalComputation.g:413:2: ( 'MUL' ) + // InternalComputation.g:414:3: 'MUL' { before(grammarAccess.getOPAccess().getMULKeyword_1()); match(input,12,FOLLOW_2); @@ -1161,20 +1239,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__OperandExpression__Alternatives" - // InternalComputation.g:398:1: rule__OperandExpression__Alternatives : ( ( ruleMaxExpression ) | ( ruleTerminalOperandExpression ) ); + // InternalComputation.g:423:1: rule__OperandExpression__Alternatives : ( ( ruleMaxExpression ) | ( ruleTerminalOperandExpression ) ); public final void rule__OperandExpression__Alternatives() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:402:1: ( ( ruleMaxExpression ) | ( ruleTerminalOperandExpression ) ) + // InternalComputation.g:427:1: ( ( ruleMaxExpression ) | ( ruleTerminalOperandExpression ) ) int alt2=2; int LA2_0 = input.LA(1); - if ( (LA2_0==26) ) { + if ( (LA2_0==28) ) { alt2=1; } - else if ( ((LA2_0>=RULE_ID && LA2_0<=RULE_INT)||LA2_0==27) ) { + else if ( ((LA2_0>=RULE_ID && LA2_0<=RULE_INT)||LA2_0==29) ) { alt2=2; } else { @@ -1185,10 +1263,10 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } switch (alt2) { case 1 : - // InternalComputation.g:403:2: ( ruleMaxExpression ) + // InternalComputation.g:428:2: ( ruleMaxExpression ) { - // InternalComputation.g:403:2: ( ruleMaxExpression ) - // InternalComputation.g:404:3: ruleMaxExpression + // InternalComputation.g:428:2: ( ruleMaxExpression ) + // InternalComputation.g:429:3: ruleMaxExpression { before(grammarAccess.getOperandExpressionAccess().getMaxExpressionParserRuleCall_0()); pushFollow(FOLLOW_2); @@ -1204,10 +1282,10 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } break; case 2 : - // InternalComputation.g:409:2: ( ruleTerminalOperandExpression ) + // InternalComputation.g:434:2: ( ruleTerminalOperandExpression ) { - // InternalComputation.g:409:2: ( ruleTerminalOperandExpression ) - // InternalComputation.g:410:3: ruleTerminalOperandExpression + // InternalComputation.g:434:2: ( ruleTerminalOperandExpression ) + // InternalComputation.g:435:3: ruleTerminalOperandExpression { before(grammarAccess.getOperandExpressionAccess().getTerminalOperandExpressionParserRuleCall_1()); pushFollow(FOLLOW_2); @@ -1240,17 +1318,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__TerminalOperandExpression__Alternatives" - // InternalComputation.g:419:1: rule__TerminalOperandExpression__Alternatives : ( ( ruleAddExpression ) | ( ruleOperandTerm ) ); + // InternalComputation.g:444:1: rule__TerminalOperandExpression__Alternatives : ( ( ruleAddExpression ) | ( ruleOperandTerm ) ); public final void rule__TerminalOperandExpression__Alternatives() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:423:1: ( ( ruleAddExpression ) | ( ruleOperandTerm ) ) + // InternalComputation.g:448:1: ( ( ruleAddExpression ) | ( ruleOperandTerm ) ) int alt3=2; int LA3_0 = input.LA(1); - if ( (LA3_0==27) ) { + if ( (LA3_0==29) ) { alt3=1; } else if ( ((LA3_0>=RULE_ID && LA3_0<=RULE_INT)) ) { @@ -1264,10 +1342,10 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } switch (alt3) { case 1 : - // InternalComputation.g:424:2: ( ruleAddExpression ) + // InternalComputation.g:449:2: ( ruleAddExpression ) { - // InternalComputation.g:424:2: ( ruleAddExpression ) - // InternalComputation.g:425:3: ruleAddExpression + // InternalComputation.g:449:2: ( ruleAddExpression ) + // InternalComputation.g:450:3: ruleAddExpression { before(grammarAccess.getTerminalOperandExpressionAccess().getAddExpressionParserRuleCall_0()); pushFollow(FOLLOW_2); @@ -1283,10 +1361,10 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } break; case 2 : - // InternalComputation.g:430:2: ( ruleOperandTerm ) + // InternalComputation.g:455:2: ( ruleOperandTerm ) { - // InternalComputation.g:430:2: ( ruleOperandTerm ) - // InternalComputation.g:431:3: ruleOperandTerm + // InternalComputation.g:455:2: ( ruleOperandTerm ) + // InternalComputation.g:456:3: ruleOperandTerm { before(grammarAccess.getTerminalOperandExpressionAccess().getOperandTermParserRuleCall_1()); pushFollow(FOLLOW_2); @@ -1319,25 +1397,25 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Alternatives" - // InternalComputation.g:440:1: rule__SummationExpression__Alternatives : ( ( ( rule__SummationExpression__Group_0__0 ) ) | ( ( rule__SummationExpression__ConstantAssignment_1 ) ) ); + // InternalComputation.g:465:1: rule__SummationExpression__Alternatives : ( ( ( rule__SummationExpression__Group_0__0 ) ) | ( ( rule__SummationExpression__ConstantAssignment_1 ) ) ); public final void rule__SummationExpression__Alternatives() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:444:1: ( ( ( rule__SummationExpression__Group_0__0 ) ) | ( ( rule__SummationExpression__ConstantAssignment_1 ) ) ) + // InternalComputation.g:469:1: ( ( ( rule__SummationExpression__Group_0__0 ) ) | ( ( rule__SummationExpression__ConstantAssignment_1 ) ) ) int alt4=2; int LA4_0 = input.LA(1); if ( (LA4_0==RULE_INT) ) { int LA4_1 = input.LA(2); - if ( (LA4_1==EOF||LA4_1==15||LA4_1==21) ) { - alt4=2; - } - else if ( (LA4_1==RULE_ID) ) { + if ( (LA4_1==RULE_ID) ) { alt4=1; } + else if ( (LA4_1==EOF||LA4_1==15||LA4_1==21) ) { + alt4=2; + } else { NoViableAltException nvae = new NoViableAltException("", 4, 1, input); @@ -1356,14 +1434,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } switch (alt4) { case 1 : - // InternalComputation.g:445:2: ( ( rule__SummationExpression__Group_0__0 ) ) + // InternalComputation.g:470:2: ( ( rule__SummationExpression__Group_0__0 ) ) { - // InternalComputation.g:445:2: ( ( rule__SummationExpression__Group_0__0 ) ) - // InternalComputation.g:446:3: ( rule__SummationExpression__Group_0__0 ) + // InternalComputation.g:470:2: ( ( rule__SummationExpression__Group_0__0 ) ) + // InternalComputation.g:471:3: ( rule__SummationExpression__Group_0__0 ) { before(grammarAccess.getSummationExpressionAccess().getGroup_0()); - // InternalComputation.g:447:3: ( rule__SummationExpression__Group_0__0 ) - // InternalComputation.g:447:4: rule__SummationExpression__Group_0__0 + // InternalComputation.g:472:3: ( rule__SummationExpression__Group_0__0 ) + // InternalComputation.g:472:4: rule__SummationExpression__Group_0__0 { pushFollow(FOLLOW_2); rule__SummationExpression__Group_0__0(); @@ -1381,14 +1459,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } break; case 2 : - // InternalComputation.g:451:2: ( ( rule__SummationExpression__ConstantAssignment_1 ) ) + // InternalComputation.g:476:2: ( ( rule__SummationExpression__ConstantAssignment_1 ) ) { - // InternalComputation.g:451:2: ( ( rule__SummationExpression__ConstantAssignment_1 ) ) - // InternalComputation.g:452:3: ( rule__SummationExpression__ConstantAssignment_1 ) + // InternalComputation.g:476:2: ( ( rule__SummationExpression__ConstantAssignment_1 ) ) + // InternalComputation.g:477:3: ( rule__SummationExpression__ConstantAssignment_1 ) { before(grammarAccess.getSummationExpressionAccess().getConstantAssignment_1()); - // InternalComputation.g:453:3: ( rule__SummationExpression__ConstantAssignment_1 ) - // InternalComputation.g:453:4: rule__SummationExpression__ConstantAssignment_1 + // InternalComputation.g:478:3: ( rule__SummationExpression__ConstantAssignment_1 ) + // InternalComputation.g:478:4: rule__SummationExpression__ConstantAssignment_1 { pushFollow(FOLLOW_2); rule__SummationExpression__ConstantAssignment_1(); @@ -1423,14 +1501,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationModel__Group__0" - // InternalComputation.g:461:1: rule__ComputationModel__Group__0 : rule__ComputationModel__Group__0__Impl rule__ComputationModel__Group__1 ; + // InternalComputation.g:486:1: rule__ComputationModel__Group__0 : rule__ComputationModel__Group__0__Impl rule__ComputationModel__Group__1 ; public final void rule__ComputationModel__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:465:1: ( rule__ComputationModel__Group__0__Impl rule__ComputationModel__Group__1 ) - // InternalComputation.g:466:2: rule__ComputationModel__Group__0__Impl rule__ComputationModel__Group__1 + // InternalComputation.g:490:1: ( rule__ComputationModel__Group__0__Impl rule__ComputationModel__Group__1 ) + // InternalComputation.g:491:2: rule__ComputationModel__Group__0__Impl rule__ComputationModel__Group__1 { pushFollow(FOLLOW_3); rule__ComputationModel__Group__0__Impl(); @@ -1461,20 +1539,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationModel__Group__0__Impl" - // InternalComputation.g:473:1: rule__ComputationModel__Group__0__Impl : ( ( rule__ComputationModel__ParametersAssignment_0 )* ) ; + // InternalComputation.g:498:1: rule__ComputationModel__Group__0__Impl : ( ( rule__ComputationModel__ParametersAssignment_0 )* ) ; public final void rule__ComputationModel__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:477:1: ( ( ( rule__ComputationModel__ParametersAssignment_0 )* ) ) - // InternalComputation.g:478:1: ( ( rule__ComputationModel__ParametersAssignment_0 )* ) + // InternalComputation.g:502:1: ( ( ( rule__ComputationModel__ParametersAssignment_0 )* ) ) + // InternalComputation.g:503:1: ( ( rule__ComputationModel__ParametersAssignment_0 )* ) { - // InternalComputation.g:478:1: ( ( rule__ComputationModel__ParametersAssignment_0 )* ) - // InternalComputation.g:479:2: ( rule__ComputationModel__ParametersAssignment_0 )* + // InternalComputation.g:503:1: ( ( rule__ComputationModel__ParametersAssignment_0 )* ) + // InternalComputation.g:504:2: ( rule__ComputationModel__ParametersAssignment_0 )* { before(grammarAccess.getComputationModelAccess().getParametersAssignment_0()); - // InternalComputation.g:480:2: ( rule__ComputationModel__ParametersAssignment_0 )* + // InternalComputation.g:505:2: ( rule__ComputationModel__ParametersAssignment_0 )* loop5: do { int alt5=2; @@ -1487,7 +1565,7 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars switch (alt5) { case 1 : - // InternalComputation.g:480:3: rule__ComputationModel__ParametersAssignment_0 + // InternalComputation.g:505:3: rule__ComputationModel__ParametersAssignment_0 { pushFollow(FOLLOW_4); rule__ComputationModel__ParametersAssignment_0(); @@ -1526,14 +1604,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationModel__Group__1" - // InternalComputation.g:488:1: rule__ComputationModel__Group__1 : rule__ComputationModel__Group__1__Impl rule__ComputationModel__Group__2 ; + // InternalComputation.g:513:1: rule__ComputationModel__Group__1 : rule__ComputationModel__Group__1__Impl rule__ComputationModel__Group__2 ; public final void rule__ComputationModel__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:492:1: ( rule__ComputationModel__Group__1__Impl rule__ComputationModel__Group__2 ) - // InternalComputation.g:493:2: rule__ComputationModel__Group__1__Impl rule__ComputationModel__Group__2 + // InternalComputation.g:517:1: ( rule__ComputationModel__Group__1__Impl rule__ComputationModel__Group__2 ) + // InternalComputation.g:518:2: rule__ComputationModel__Group__1__Impl rule__ComputationModel__Group__2 { pushFollow(FOLLOW_5); rule__ComputationModel__Group__1__Impl(); @@ -1564,21 +1642,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationModel__Group__1__Impl" - // InternalComputation.g:500:1: rule__ComputationModel__Group__1__Impl : ( ( rule__ComputationModel__TargetDesignAssignment_1 ) ) ; + // InternalComputation.g:525:1: rule__ComputationModel__Group__1__Impl : ( ( rule__ComputationModel__TargetDesignAssignment_1 ) ) ; public final void rule__ComputationModel__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:504:1: ( ( ( rule__ComputationModel__TargetDesignAssignment_1 ) ) ) - // InternalComputation.g:505:1: ( ( rule__ComputationModel__TargetDesignAssignment_1 ) ) + // InternalComputation.g:529:1: ( ( ( rule__ComputationModel__TargetDesignAssignment_1 ) ) ) + // InternalComputation.g:530:1: ( ( rule__ComputationModel__TargetDesignAssignment_1 ) ) { - // InternalComputation.g:505:1: ( ( rule__ComputationModel__TargetDesignAssignment_1 ) ) - // InternalComputation.g:506:2: ( rule__ComputationModel__TargetDesignAssignment_1 ) + // InternalComputation.g:530:1: ( ( rule__ComputationModel__TargetDesignAssignment_1 ) ) + // InternalComputation.g:531:2: ( rule__ComputationModel__TargetDesignAssignment_1 ) { before(grammarAccess.getComputationModelAccess().getTargetDesignAssignment_1()); - // InternalComputation.g:507:2: ( rule__ComputationModel__TargetDesignAssignment_1 ) - // InternalComputation.g:507:3: rule__ComputationModel__TargetDesignAssignment_1 + // InternalComputation.g:532:2: ( rule__ComputationModel__TargetDesignAssignment_1 ) + // InternalComputation.g:532:3: rule__ComputationModel__TargetDesignAssignment_1 { pushFollow(FOLLOW_2); rule__ComputationModel__TargetDesignAssignment_1(); @@ -1611,20 +1689,25 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationModel__Group__2" - // InternalComputation.g:515:1: rule__ComputationModel__Group__2 : rule__ComputationModel__Group__2__Impl ; + // InternalComputation.g:540:1: rule__ComputationModel__Group__2 : rule__ComputationModel__Group__2__Impl rule__ComputationModel__Group__3 ; public final void rule__ComputationModel__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:519:1: ( rule__ComputationModel__Group__2__Impl ) - // InternalComputation.g:520:2: rule__ComputationModel__Group__2__Impl + // InternalComputation.g:544:1: ( rule__ComputationModel__Group__2__Impl rule__ComputationModel__Group__3 ) + // InternalComputation.g:545:2: rule__ComputationModel__Group__2__Impl rule__ComputationModel__Group__3 { - pushFollow(FOLLOW_2); + pushFollow(FOLLOW_5); rule__ComputationModel__Group__2__Impl(); state._fsp--; + pushFollow(FOLLOW_2); + rule__ComputationModel__Group__3(); + + state._fsp--; + } @@ -1644,58 +1727,156 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationModel__Group__2__Impl" - // InternalComputation.g:526:1: rule__ComputationModel__Group__2__Impl : ( ( ( rule__ComputationModel__BlocksAssignment_2 ) ) ( ( rule__ComputationModel__BlocksAssignment_2 )* ) ) ; + // InternalComputation.g:552:1: rule__ComputationModel__Group__2__Impl : ( ( rule__ComputationModel__BlockGroupsAssignment_2 )* ) ; public final void rule__ComputationModel__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:530:1: ( ( ( ( rule__ComputationModel__BlocksAssignment_2 ) ) ( ( rule__ComputationModel__BlocksAssignment_2 )* ) ) ) - // InternalComputation.g:531:1: ( ( ( rule__ComputationModel__BlocksAssignment_2 ) ) ( ( rule__ComputationModel__BlocksAssignment_2 )* ) ) + // InternalComputation.g:556:1: ( ( ( rule__ComputationModel__BlockGroupsAssignment_2 )* ) ) + // InternalComputation.g:557:1: ( ( rule__ComputationModel__BlockGroupsAssignment_2 )* ) + { + // InternalComputation.g:557:1: ( ( rule__ComputationModel__BlockGroupsAssignment_2 )* ) + // InternalComputation.g:558:2: ( rule__ComputationModel__BlockGroupsAssignment_2 )* + { + before(grammarAccess.getComputationModelAccess().getBlockGroupsAssignment_2()); + // InternalComputation.g:559:2: ( rule__ComputationModel__BlockGroupsAssignment_2 )* + loop6: + do { + int alt6=2; + int LA6_0 = input.LA(1); + + if ( (LA6_0==22) ) { + alt6=1; + } + + + switch (alt6) { + case 1 : + // InternalComputation.g:559:3: rule__ComputationModel__BlockGroupsAssignment_2 + { + pushFollow(FOLLOW_6); + rule__ComputationModel__BlockGroupsAssignment_2(); + + state._fsp--; + + + } + break; + + default : + break loop6; + } + } while (true); + + after(grammarAccess.getComputationModelAccess().getBlockGroupsAssignment_2()); + + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__ComputationModel__Group__2__Impl" + + + // $ANTLR start "rule__ComputationModel__Group__3" + // InternalComputation.g:567:1: rule__ComputationModel__Group__3 : rule__ComputationModel__Group__3__Impl ; + public final void rule__ComputationModel__Group__3() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:571:1: ( rule__ComputationModel__Group__3__Impl ) + // InternalComputation.g:572:2: rule__ComputationModel__Group__3__Impl + { + pushFollow(FOLLOW_2); + rule__ComputationModel__Group__3__Impl(); + + state._fsp--; + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__ComputationModel__Group__3" + + + // $ANTLR start "rule__ComputationModel__Group__3__Impl" + // InternalComputation.g:578:1: rule__ComputationModel__Group__3__Impl : ( ( ( rule__ComputationModel__BlocksAssignment_3 ) ) ( ( rule__ComputationModel__BlocksAssignment_3 )* ) ) ; + public final void rule__ComputationModel__Group__3__Impl() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:582:1: ( ( ( ( rule__ComputationModel__BlocksAssignment_3 ) ) ( ( rule__ComputationModel__BlocksAssignment_3 )* ) ) ) + // InternalComputation.g:583:1: ( ( ( rule__ComputationModel__BlocksAssignment_3 ) ) ( ( rule__ComputationModel__BlocksAssignment_3 )* ) ) { - // InternalComputation.g:531:1: ( ( ( rule__ComputationModel__BlocksAssignment_2 ) ) ( ( rule__ComputationModel__BlocksAssignment_2 )* ) ) - // InternalComputation.g:532:2: ( ( rule__ComputationModel__BlocksAssignment_2 ) ) ( ( rule__ComputationModel__BlocksAssignment_2 )* ) + // InternalComputation.g:583:1: ( ( ( rule__ComputationModel__BlocksAssignment_3 ) ) ( ( rule__ComputationModel__BlocksAssignment_3 )* ) ) + // InternalComputation.g:584:2: ( ( rule__ComputationModel__BlocksAssignment_3 ) ) ( ( rule__ComputationModel__BlocksAssignment_3 )* ) { - // InternalComputation.g:532:2: ( ( rule__ComputationModel__BlocksAssignment_2 ) ) - // InternalComputation.g:533:3: ( rule__ComputationModel__BlocksAssignment_2 ) + // InternalComputation.g:584:2: ( ( rule__ComputationModel__BlocksAssignment_3 ) ) + // InternalComputation.g:585:3: ( rule__ComputationModel__BlocksAssignment_3 ) { - before(grammarAccess.getComputationModelAccess().getBlocksAssignment_2()); - // InternalComputation.g:534:3: ( rule__ComputationModel__BlocksAssignment_2 ) - // InternalComputation.g:534:4: rule__ComputationModel__BlocksAssignment_2 + before(grammarAccess.getComputationModelAccess().getBlocksAssignment_3()); + // InternalComputation.g:586:3: ( rule__ComputationModel__BlocksAssignment_3 ) + // InternalComputation.g:586:4: rule__ComputationModel__BlocksAssignment_3 { - pushFollow(FOLLOW_6); - rule__ComputationModel__BlocksAssignment_2(); + pushFollow(FOLLOW_7); + rule__ComputationModel__BlocksAssignment_3(); state._fsp--; } - after(grammarAccess.getComputationModelAccess().getBlocksAssignment_2()); + after(grammarAccess.getComputationModelAccess().getBlocksAssignment_3()); } - // InternalComputation.g:537:2: ( ( rule__ComputationModel__BlocksAssignment_2 )* ) - // InternalComputation.g:538:3: ( rule__ComputationModel__BlocksAssignment_2 )* + // InternalComputation.g:589:2: ( ( rule__ComputationModel__BlocksAssignment_3 )* ) + // InternalComputation.g:590:3: ( rule__ComputationModel__BlocksAssignment_3 )* { - before(grammarAccess.getComputationModelAccess().getBlocksAssignment_2()); - // InternalComputation.g:539:3: ( rule__ComputationModel__BlocksAssignment_2 )* - loop6: + before(grammarAccess.getComputationModelAccess().getBlocksAssignment_3()); + // InternalComputation.g:591:3: ( rule__ComputationModel__BlocksAssignment_3 )* + loop7: do { - int alt6=2; - int LA6_0 = input.LA(1); + int alt7=2; + int LA7_0 = input.LA(1); - if ( (LA6_0==22) ) { - alt6=1; + if ( (LA7_0==24) ) { + alt7=1; } - switch (alt6) { + switch (alt7) { case 1 : - // InternalComputation.g:539:4: rule__ComputationModel__BlocksAssignment_2 + // InternalComputation.g:591:4: rule__ComputationModel__BlocksAssignment_3 { - pushFollow(FOLLOW_6); - rule__ComputationModel__BlocksAssignment_2(); + pushFollow(FOLLOW_7); + rule__ComputationModel__BlocksAssignment_3(); state._fsp--; @@ -1704,11 +1885,11 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars break; default : - break loop6; + break loop7; } } while (true); - after(grammarAccess.getComputationModelAccess().getBlocksAssignment_2()); + after(grammarAccess.getComputationModelAccess().getBlocksAssignment_3()); } @@ -1730,20 +1911,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } return ; } - // $ANTLR end "rule__ComputationModel__Group__2__Impl" + // $ANTLR end "rule__ComputationModel__Group__3__Impl" // $ANTLR start "rule__Parameter__Group__0" - // InternalComputation.g:549:1: rule__Parameter__Group__0 : rule__Parameter__Group__0__Impl rule__Parameter__Group__1 ; + // InternalComputation.g:601:1: rule__Parameter__Group__0 : rule__Parameter__Group__0__Impl rule__Parameter__Group__1 ; public final void rule__Parameter__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:553:1: ( rule__Parameter__Group__0__Impl rule__Parameter__Group__1 ) - // InternalComputation.g:554:2: rule__Parameter__Group__0__Impl rule__Parameter__Group__1 + // InternalComputation.g:605:1: ( rule__Parameter__Group__0__Impl rule__Parameter__Group__1 ) + // InternalComputation.g:606:2: rule__Parameter__Group__0__Impl rule__Parameter__Group__1 { - pushFollow(FOLLOW_7); + pushFollow(FOLLOW_8); rule__Parameter__Group__0__Impl(); state._fsp--; @@ -1772,17 +1953,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Parameter__Group__0__Impl" - // InternalComputation.g:561:1: rule__Parameter__Group__0__Impl : ( 'param' ) ; + // InternalComputation.g:613:1: rule__Parameter__Group__0__Impl : ( 'param' ) ; public final void rule__Parameter__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:565:1: ( ( 'param' ) ) - // InternalComputation.g:566:1: ( 'param' ) + // InternalComputation.g:617:1: ( ( 'param' ) ) + // InternalComputation.g:618:1: ( 'param' ) { - // InternalComputation.g:566:1: ( 'param' ) - // InternalComputation.g:567:2: 'param' + // InternalComputation.g:618:1: ( 'param' ) + // InternalComputation.g:619:2: 'param' { before(grammarAccess.getParameterAccess().getParamKeyword_0()); match(input,13,FOLLOW_2); @@ -1809,16 +1990,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Parameter__Group__1" - // InternalComputation.g:576:1: rule__Parameter__Group__1 : rule__Parameter__Group__1__Impl rule__Parameter__Group__2 ; + // InternalComputation.g:628:1: rule__Parameter__Group__1 : rule__Parameter__Group__1__Impl rule__Parameter__Group__2 ; public final void rule__Parameter__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:580:1: ( rule__Parameter__Group__1__Impl rule__Parameter__Group__2 ) - // InternalComputation.g:581:2: rule__Parameter__Group__1__Impl rule__Parameter__Group__2 + // InternalComputation.g:632:1: ( rule__Parameter__Group__1__Impl rule__Parameter__Group__2 ) + // InternalComputation.g:633:2: rule__Parameter__Group__1__Impl rule__Parameter__Group__2 { - pushFollow(FOLLOW_8); + pushFollow(FOLLOW_9); rule__Parameter__Group__1__Impl(); state._fsp--; @@ -1847,21 +2028,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Parameter__Group__1__Impl" - // InternalComputation.g:588:1: rule__Parameter__Group__1__Impl : ( ( rule__Parameter__NameAssignment_1 ) ) ; + // InternalComputation.g:640:1: rule__Parameter__Group__1__Impl : ( ( rule__Parameter__NameAssignment_1 ) ) ; public final void rule__Parameter__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:592:1: ( ( ( rule__Parameter__NameAssignment_1 ) ) ) - // InternalComputation.g:593:1: ( ( rule__Parameter__NameAssignment_1 ) ) + // InternalComputation.g:644:1: ( ( ( rule__Parameter__NameAssignment_1 ) ) ) + // InternalComputation.g:645:1: ( ( rule__Parameter__NameAssignment_1 ) ) { - // InternalComputation.g:593:1: ( ( rule__Parameter__NameAssignment_1 ) ) - // InternalComputation.g:594:2: ( rule__Parameter__NameAssignment_1 ) + // InternalComputation.g:645:1: ( ( rule__Parameter__NameAssignment_1 ) ) + // InternalComputation.g:646:2: ( rule__Parameter__NameAssignment_1 ) { before(grammarAccess.getParameterAccess().getNameAssignment_1()); - // InternalComputation.g:595:2: ( rule__Parameter__NameAssignment_1 ) - // InternalComputation.g:595:3: rule__Parameter__NameAssignment_1 + // InternalComputation.g:647:2: ( rule__Parameter__NameAssignment_1 ) + // InternalComputation.g:647:3: rule__Parameter__NameAssignment_1 { pushFollow(FOLLOW_2); rule__Parameter__NameAssignment_1(); @@ -1894,16 +2075,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Parameter__Group__2" - // InternalComputation.g:603:1: rule__Parameter__Group__2 : rule__Parameter__Group__2__Impl rule__Parameter__Group__3 ; + // InternalComputation.g:655:1: rule__Parameter__Group__2 : rule__Parameter__Group__2__Impl rule__Parameter__Group__3 ; public final void rule__Parameter__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:607:1: ( rule__Parameter__Group__2__Impl rule__Parameter__Group__3 ) - // InternalComputation.g:608:2: rule__Parameter__Group__2__Impl rule__Parameter__Group__3 + // InternalComputation.g:659:1: ( rule__Parameter__Group__2__Impl rule__Parameter__Group__3 ) + // InternalComputation.g:660:2: rule__Parameter__Group__2__Impl rule__Parameter__Group__3 { - pushFollow(FOLLOW_9); + pushFollow(FOLLOW_10); rule__Parameter__Group__2__Impl(); state._fsp--; @@ -1932,17 +2113,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Parameter__Group__2__Impl" - // InternalComputation.g:615:1: rule__Parameter__Group__2__Impl : ( '=' ) ; + // InternalComputation.g:667:1: rule__Parameter__Group__2__Impl : ( '=' ) ; public final void rule__Parameter__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:619:1: ( ( '=' ) ) - // InternalComputation.g:620:1: ( '=' ) + // InternalComputation.g:671:1: ( ( '=' ) ) + // InternalComputation.g:672:1: ( '=' ) { - // InternalComputation.g:620:1: ( '=' ) - // InternalComputation.g:621:2: '=' + // InternalComputation.g:672:1: ( '=' ) + // InternalComputation.g:673:2: '=' { before(grammarAccess.getParameterAccess().getEqualsSignKeyword_2()); match(input,14,FOLLOW_2); @@ -1969,16 +2150,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Parameter__Group__3" - // InternalComputation.g:630:1: rule__Parameter__Group__3 : rule__Parameter__Group__3__Impl rule__Parameter__Group__4 ; + // InternalComputation.g:682:1: rule__Parameter__Group__3 : rule__Parameter__Group__3__Impl rule__Parameter__Group__4 ; public final void rule__Parameter__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:634:1: ( rule__Parameter__Group__3__Impl rule__Parameter__Group__4 ) - // InternalComputation.g:635:2: rule__Parameter__Group__3__Impl rule__Parameter__Group__4 + // InternalComputation.g:686:1: ( rule__Parameter__Group__3__Impl rule__Parameter__Group__4 ) + // InternalComputation.g:687:2: rule__Parameter__Group__3__Impl rule__Parameter__Group__4 { - pushFollow(FOLLOW_10); + pushFollow(FOLLOW_11); rule__Parameter__Group__3__Impl(); state._fsp--; @@ -2007,21 +2188,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Parameter__Group__3__Impl" - // InternalComputation.g:642:1: rule__Parameter__Group__3__Impl : ( ( rule__Parameter__ValueAssignment_3 ) ) ; + // InternalComputation.g:694:1: rule__Parameter__Group__3__Impl : ( ( rule__Parameter__ValueAssignment_3 ) ) ; public final void rule__Parameter__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:646:1: ( ( ( rule__Parameter__ValueAssignment_3 ) ) ) - // InternalComputation.g:647:1: ( ( rule__Parameter__ValueAssignment_3 ) ) + // InternalComputation.g:698:1: ( ( ( rule__Parameter__ValueAssignment_3 ) ) ) + // InternalComputation.g:699:1: ( ( rule__Parameter__ValueAssignment_3 ) ) { - // InternalComputation.g:647:1: ( ( rule__Parameter__ValueAssignment_3 ) ) - // InternalComputation.g:648:2: ( rule__Parameter__ValueAssignment_3 ) + // InternalComputation.g:699:1: ( ( rule__Parameter__ValueAssignment_3 ) ) + // InternalComputation.g:700:2: ( rule__Parameter__ValueAssignment_3 ) { before(grammarAccess.getParameterAccess().getValueAssignment_3()); - // InternalComputation.g:649:2: ( rule__Parameter__ValueAssignment_3 ) - // InternalComputation.g:649:3: rule__Parameter__ValueAssignment_3 + // InternalComputation.g:701:2: ( rule__Parameter__ValueAssignment_3 ) + // InternalComputation.g:701:3: rule__Parameter__ValueAssignment_3 { pushFollow(FOLLOW_2); rule__Parameter__ValueAssignment_3(); @@ -2054,14 +2235,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Parameter__Group__4" - // InternalComputation.g:657:1: rule__Parameter__Group__4 : rule__Parameter__Group__4__Impl ; + // InternalComputation.g:709:1: rule__Parameter__Group__4 : rule__Parameter__Group__4__Impl ; public final void rule__Parameter__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:661:1: ( rule__Parameter__Group__4__Impl ) - // InternalComputation.g:662:2: rule__Parameter__Group__4__Impl + // InternalComputation.g:713:1: ( rule__Parameter__Group__4__Impl ) + // InternalComputation.g:714:2: rule__Parameter__Group__4__Impl { pushFollow(FOLLOW_2); rule__Parameter__Group__4__Impl(); @@ -2087,17 +2268,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Parameter__Group__4__Impl" - // InternalComputation.g:668:1: rule__Parameter__Group__4__Impl : ( ';' ) ; + // InternalComputation.g:720:1: rule__Parameter__Group__4__Impl : ( ';' ) ; public final void rule__Parameter__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:672:1: ( ( ';' ) ) - // InternalComputation.g:673:1: ( ';' ) + // InternalComputation.g:724:1: ( ( ';' ) ) + // InternalComputation.g:725:1: ( ';' ) { - // InternalComputation.g:673:1: ( ';' ) - // InternalComputation.g:674:2: ';' + // InternalComputation.g:725:1: ( ';' ) + // InternalComputation.g:726:2: ';' { before(grammarAccess.getParameterAccess().getSemicolonKeyword_4()); match(input,15,FOLLOW_2); @@ -2124,16 +2305,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__0" - // InternalComputation.g:684:1: rule__HWTargetDesign__Group__0 : rule__HWTargetDesign__Group__0__Impl rule__HWTargetDesign__Group__1 ; + // InternalComputation.g:736:1: rule__HWTargetDesign__Group__0 : rule__HWTargetDesign__Group__0__Impl rule__HWTargetDesign__Group__1 ; public final void rule__HWTargetDesign__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:688:1: ( rule__HWTargetDesign__Group__0__Impl rule__HWTargetDesign__Group__1 ) - // InternalComputation.g:689:2: rule__HWTargetDesign__Group__0__Impl rule__HWTargetDesign__Group__1 + // InternalComputation.g:740:1: ( rule__HWTargetDesign__Group__0__Impl rule__HWTargetDesign__Group__1 ) + // InternalComputation.g:741:2: rule__HWTargetDesign__Group__0__Impl rule__HWTargetDesign__Group__1 { - pushFollow(FOLLOW_11); + pushFollow(FOLLOW_12); rule__HWTargetDesign__Group__0__Impl(); state._fsp--; @@ -2162,17 +2343,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__0__Impl" - // InternalComputation.g:696:1: rule__HWTargetDesign__Group__0__Impl : ( 'target' ) ; + // InternalComputation.g:748:1: rule__HWTargetDesign__Group__0__Impl : ( 'target' ) ; public final void rule__HWTargetDesign__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:700:1: ( ( 'target' ) ) - // InternalComputation.g:701:1: ( 'target' ) + // InternalComputation.g:752:1: ( ( 'target' ) ) + // InternalComputation.g:753:1: ( 'target' ) { - // InternalComputation.g:701:1: ( 'target' ) - // InternalComputation.g:702:2: 'target' + // InternalComputation.g:753:1: ( 'target' ) + // InternalComputation.g:754:2: 'target' { before(grammarAccess.getHWTargetDesignAccess().getTargetKeyword_0()); match(input,16,FOLLOW_2); @@ -2199,16 +2380,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__1" - // InternalComputation.g:711:1: rule__HWTargetDesign__Group__1 : rule__HWTargetDesign__Group__1__Impl rule__HWTargetDesign__Group__2 ; + // InternalComputation.g:763:1: rule__HWTargetDesign__Group__1 : rule__HWTargetDesign__Group__1__Impl rule__HWTargetDesign__Group__2 ; public final void rule__HWTargetDesign__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:715:1: ( rule__HWTargetDesign__Group__1__Impl rule__HWTargetDesign__Group__2 ) - // InternalComputation.g:716:2: rule__HWTargetDesign__Group__1__Impl rule__HWTargetDesign__Group__2 + // InternalComputation.g:767:1: ( rule__HWTargetDesign__Group__1__Impl rule__HWTargetDesign__Group__2 ) + // InternalComputation.g:768:2: rule__HWTargetDesign__Group__1__Impl rule__HWTargetDesign__Group__2 { - pushFollow(FOLLOW_12); + pushFollow(FOLLOW_13); rule__HWTargetDesign__Group__1__Impl(); state._fsp--; @@ -2237,17 +2418,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__1__Impl" - // InternalComputation.g:723:1: rule__HWTargetDesign__Group__1__Impl : ( '{' ) ; + // InternalComputation.g:775:1: rule__HWTargetDesign__Group__1__Impl : ( '{' ) ; public final void rule__HWTargetDesign__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:727:1: ( ( '{' ) ) - // InternalComputation.g:728:1: ( '{' ) + // InternalComputation.g:779:1: ( ( '{' ) ) + // InternalComputation.g:780:1: ( '{' ) { - // InternalComputation.g:728:1: ( '{' ) - // InternalComputation.g:729:2: '{' + // InternalComputation.g:780:1: ( '{' ) + // InternalComputation.g:781:2: '{' { before(grammarAccess.getHWTargetDesignAccess().getLeftCurlyBracketKeyword_1()); match(input,17,FOLLOW_2); @@ -2274,16 +2455,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__2" - // InternalComputation.g:738:1: rule__HWTargetDesign__Group__2 : rule__HWTargetDesign__Group__2__Impl rule__HWTargetDesign__Group__3 ; + // InternalComputation.g:790:1: rule__HWTargetDesign__Group__2 : rule__HWTargetDesign__Group__2__Impl rule__HWTargetDesign__Group__3 ; public final void rule__HWTargetDesign__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:742:1: ( rule__HWTargetDesign__Group__2__Impl rule__HWTargetDesign__Group__3 ) - // InternalComputation.g:743:2: rule__HWTargetDesign__Group__2__Impl rule__HWTargetDesign__Group__3 + // InternalComputation.g:794:1: ( rule__HWTargetDesign__Group__2__Impl rule__HWTargetDesign__Group__3 ) + // InternalComputation.g:795:2: rule__HWTargetDesign__Group__2__Impl rule__HWTargetDesign__Group__3 { - pushFollow(FOLLOW_8); + pushFollow(FOLLOW_9); rule__HWTargetDesign__Group__2__Impl(); state._fsp--; @@ -2312,17 +2493,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__2__Impl" - // InternalComputation.g:750:1: rule__HWTargetDesign__Group__2__Impl : ( 'frequency' ) ; + // InternalComputation.g:802:1: rule__HWTargetDesign__Group__2__Impl : ( 'frequency' ) ; public final void rule__HWTargetDesign__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:754:1: ( ( 'frequency' ) ) - // InternalComputation.g:755:1: ( 'frequency' ) + // InternalComputation.g:806:1: ( ( 'frequency' ) ) + // InternalComputation.g:807:1: ( 'frequency' ) { - // InternalComputation.g:755:1: ( 'frequency' ) - // InternalComputation.g:756:2: 'frequency' + // InternalComputation.g:807:1: ( 'frequency' ) + // InternalComputation.g:808:2: 'frequency' { before(grammarAccess.getHWTargetDesignAccess().getFrequencyKeyword_2()); match(input,18,FOLLOW_2); @@ -2349,16 +2530,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__3" - // InternalComputation.g:765:1: rule__HWTargetDesign__Group__3 : rule__HWTargetDesign__Group__3__Impl rule__HWTargetDesign__Group__4 ; + // InternalComputation.g:817:1: rule__HWTargetDesign__Group__3 : rule__HWTargetDesign__Group__3__Impl rule__HWTargetDesign__Group__4 ; public final void rule__HWTargetDesign__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:769:1: ( rule__HWTargetDesign__Group__3__Impl rule__HWTargetDesign__Group__4 ) - // InternalComputation.g:770:2: rule__HWTargetDesign__Group__3__Impl rule__HWTargetDesign__Group__4 + // InternalComputation.g:821:1: ( rule__HWTargetDesign__Group__3__Impl rule__HWTargetDesign__Group__4 ) + // InternalComputation.g:822:2: rule__HWTargetDesign__Group__3__Impl rule__HWTargetDesign__Group__4 { - pushFollow(FOLLOW_9); + pushFollow(FOLLOW_10); rule__HWTargetDesign__Group__3__Impl(); state._fsp--; @@ -2387,17 +2568,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__3__Impl" - // InternalComputation.g:777:1: rule__HWTargetDesign__Group__3__Impl : ( '=' ) ; + // InternalComputation.g:829:1: rule__HWTargetDesign__Group__3__Impl : ( '=' ) ; public final void rule__HWTargetDesign__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:781:1: ( ( '=' ) ) - // InternalComputation.g:782:1: ( '=' ) + // InternalComputation.g:833:1: ( ( '=' ) ) + // InternalComputation.g:834:1: ( '=' ) { - // InternalComputation.g:782:1: ( '=' ) - // InternalComputation.g:783:2: '=' + // InternalComputation.g:834:1: ( '=' ) + // InternalComputation.g:835:2: '=' { before(grammarAccess.getHWTargetDesignAccess().getEqualsSignKeyword_3()); match(input,14,FOLLOW_2); @@ -2424,16 +2605,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__4" - // InternalComputation.g:792:1: rule__HWTargetDesign__Group__4 : rule__HWTargetDesign__Group__4__Impl rule__HWTargetDesign__Group__5 ; + // InternalComputation.g:844:1: rule__HWTargetDesign__Group__4 : rule__HWTargetDesign__Group__4__Impl rule__HWTargetDesign__Group__5 ; public final void rule__HWTargetDesign__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:796:1: ( rule__HWTargetDesign__Group__4__Impl rule__HWTargetDesign__Group__5 ) - // InternalComputation.g:797:2: rule__HWTargetDesign__Group__4__Impl rule__HWTargetDesign__Group__5 + // InternalComputation.g:848:1: ( rule__HWTargetDesign__Group__4__Impl rule__HWTargetDesign__Group__5 ) + // InternalComputation.g:849:2: rule__HWTargetDesign__Group__4__Impl rule__HWTargetDesign__Group__5 { - pushFollow(FOLLOW_13); + pushFollow(FOLLOW_14); rule__HWTargetDesign__Group__4__Impl(); state._fsp--; @@ -2462,21 +2643,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__4__Impl" - // InternalComputation.g:804:1: rule__HWTargetDesign__Group__4__Impl : ( ( rule__HWTargetDesign__FrequencyAssignment_4 ) ) ; + // InternalComputation.g:856:1: rule__HWTargetDesign__Group__4__Impl : ( ( rule__HWTargetDesign__FrequencyAssignment_4 ) ) ; public final void rule__HWTargetDesign__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:808:1: ( ( ( rule__HWTargetDesign__FrequencyAssignment_4 ) ) ) - // InternalComputation.g:809:1: ( ( rule__HWTargetDesign__FrequencyAssignment_4 ) ) + // InternalComputation.g:860:1: ( ( ( rule__HWTargetDesign__FrequencyAssignment_4 ) ) ) + // InternalComputation.g:861:1: ( ( rule__HWTargetDesign__FrequencyAssignment_4 ) ) { - // InternalComputation.g:809:1: ( ( rule__HWTargetDesign__FrequencyAssignment_4 ) ) - // InternalComputation.g:810:2: ( rule__HWTargetDesign__FrequencyAssignment_4 ) + // InternalComputation.g:861:1: ( ( rule__HWTargetDesign__FrequencyAssignment_4 ) ) + // InternalComputation.g:862:2: ( rule__HWTargetDesign__FrequencyAssignment_4 ) { before(grammarAccess.getHWTargetDesignAccess().getFrequencyAssignment_4()); - // InternalComputation.g:811:2: ( rule__HWTargetDesign__FrequencyAssignment_4 ) - // InternalComputation.g:811:3: rule__HWTargetDesign__FrequencyAssignment_4 + // InternalComputation.g:863:2: ( rule__HWTargetDesign__FrequencyAssignment_4 ) + // InternalComputation.g:863:3: rule__HWTargetDesign__FrequencyAssignment_4 { pushFollow(FOLLOW_2); rule__HWTargetDesign__FrequencyAssignment_4(); @@ -2509,16 +2690,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__5" - // InternalComputation.g:819:1: rule__HWTargetDesign__Group__5 : rule__HWTargetDesign__Group__5__Impl rule__HWTargetDesign__Group__6 ; + // InternalComputation.g:871:1: rule__HWTargetDesign__Group__5 : rule__HWTargetDesign__Group__5__Impl rule__HWTargetDesign__Group__6 ; public final void rule__HWTargetDesign__Group__5() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:823:1: ( rule__HWTargetDesign__Group__5__Impl rule__HWTargetDesign__Group__6 ) - // InternalComputation.g:824:2: rule__HWTargetDesign__Group__5__Impl rule__HWTargetDesign__Group__6 + // InternalComputation.g:875:1: ( rule__HWTargetDesign__Group__5__Impl rule__HWTargetDesign__Group__6 ) + // InternalComputation.g:876:2: rule__HWTargetDesign__Group__5__Impl rule__HWTargetDesign__Group__6 { - pushFollow(FOLLOW_8); + pushFollow(FOLLOW_9); rule__HWTargetDesign__Group__5__Impl(); state._fsp--; @@ -2547,17 +2728,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__5__Impl" - // InternalComputation.g:831:1: rule__HWTargetDesign__Group__5__Impl : ( 'outputsPerCycle' ) ; + // InternalComputation.g:883:1: rule__HWTargetDesign__Group__5__Impl : ( 'outputsPerCycle' ) ; public final void rule__HWTargetDesign__Group__5__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:835:1: ( ( 'outputsPerCycle' ) ) - // InternalComputation.g:836:1: ( 'outputsPerCycle' ) + // InternalComputation.g:887:1: ( ( 'outputsPerCycle' ) ) + // InternalComputation.g:888:1: ( 'outputsPerCycle' ) { - // InternalComputation.g:836:1: ( 'outputsPerCycle' ) - // InternalComputation.g:837:2: 'outputsPerCycle' + // InternalComputation.g:888:1: ( 'outputsPerCycle' ) + // InternalComputation.g:889:2: 'outputsPerCycle' { before(grammarAccess.getHWTargetDesignAccess().getOutputsPerCycleKeyword_5()); match(input,19,FOLLOW_2); @@ -2584,16 +2765,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__6" - // InternalComputation.g:846:1: rule__HWTargetDesign__Group__6 : rule__HWTargetDesign__Group__6__Impl rule__HWTargetDesign__Group__7 ; + // InternalComputation.g:898:1: rule__HWTargetDesign__Group__6 : rule__HWTargetDesign__Group__6__Impl rule__HWTargetDesign__Group__7 ; public final void rule__HWTargetDesign__Group__6() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:850:1: ( rule__HWTargetDesign__Group__6__Impl rule__HWTargetDesign__Group__7 ) - // InternalComputation.g:851:2: rule__HWTargetDesign__Group__6__Impl rule__HWTargetDesign__Group__7 + // InternalComputation.g:902:1: ( rule__HWTargetDesign__Group__6__Impl rule__HWTargetDesign__Group__7 ) + // InternalComputation.g:903:2: rule__HWTargetDesign__Group__6__Impl rule__HWTargetDesign__Group__7 { - pushFollow(FOLLOW_9); + pushFollow(FOLLOW_10); rule__HWTargetDesign__Group__6__Impl(); state._fsp--; @@ -2622,17 +2803,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__6__Impl" - // InternalComputation.g:858:1: rule__HWTargetDesign__Group__6__Impl : ( '=' ) ; + // InternalComputation.g:910:1: rule__HWTargetDesign__Group__6__Impl : ( '=' ) ; public final void rule__HWTargetDesign__Group__6__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:862:1: ( ( '=' ) ) - // InternalComputation.g:863:1: ( '=' ) + // InternalComputation.g:914:1: ( ( '=' ) ) + // InternalComputation.g:915:1: ( '=' ) { - // InternalComputation.g:863:1: ( '=' ) - // InternalComputation.g:864:2: '=' + // InternalComputation.g:915:1: ( '=' ) + // InternalComputation.g:916:2: '=' { before(grammarAccess.getHWTargetDesignAccess().getEqualsSignKeyword_6()); match(input,14,FOLLOW_2); @@ -2659,16 +2840,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__7" - // InternalComputation.g:873:1: rule__HWTargetDesign__Group__7 : rule__HWTargetDesign__Group__7__Impl rule__HWTargetDesign__Group__8 ; + // InternalComputation.g:925:1: rule__HWTargetDesign__Group__7 : rule__HWTargetDesign__Group__7__Impl rule__HWTargetDesign__Group__8 ; public final void rule__HWTargetDesign__Group__7() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:877:1: ( rule__HWTargetDesign__Group__7__Impl rule__HWTargetDesign__Group__8 ) - // InternalComputation.g:878:2: rule__HWTargetDesign__Group__7__Impl rule__HWTargetDesign__Group__8 + // InternalComputation.g:929:1: ( rule__HWTargetDesign__Group__7__Impl rule__HWTargetDesign__Group__8 ) + // InternalComputation.g:930:2: rule__HWTargetDesign__Group__7__Impl rule__HWTargetDesign__Group__8 { - pushFollow(FOLLOW_14); + pushFollow(FOLLOW_15); rule__HWTargetDesign__Group__7__Impl(); state._fsp--; @@ -2697,21 +2878,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__7__Impl" - // InternalComputation.g:885:1: rule__HWTargetDesign__Group__7__Impl : ( ( rule__HWTargetDesign__OutputsPerCycleAssignment_7 ) ) ; + // InternalComputation.g:937:1: rule__HWTargetDesign__Group__7__Impl : ( ( rule__HWTargetDesign__OutputsPerCycleAssignment_7 ) ) ; public final void rule__HWTargetDesign__Group__7__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:889:1: ( ( ( rule__HWTargetDesign__OutputsPerCycleAssignment_7 ) ) ) - // InternalComputation.g:890:1: ( ( rule__HWTargetDesign__OutputsPerCycleAssignment_7 ) ) + // InternalComputation.g:941:1: ( ( ( rule__HWTargetDesign__OutputsPerCycleAssignment_7 ) ) ) + // InternalComputation.g:942:1: ( ( rule__HWTargetDesign__OutputsPerCycleAssignment_7 ) ) { - // InternalComputation.g:890:1: ( ( rule__HWTargetDesign__OutputsPerCycleAssignment_7 ) ) - // InternalComputation.g:891:2: ( rule__HWTargetDesign__OutputsPerCycleAssignment_7 ) + // InternalComputation.g:942:1: ( ( rule__HWTargetDesign__OutputsPerCycleAssignment_7 ) ) + // InternalComputation.g:943:2: ( rule__HWTargetDesign__OutputsPerCycleAssignment_7 ) { before(grammarAccess.getHWTargetDesignAccess().getOutputsPerCycleAssignment_7()); - // InternalComputation.g:892:2: ( rule__HWTargetDesign__OutputsPerCycleAssignment_7 ) - // InternalComputation.g:892:3: rule__HWTargetDesign__OutputsPerCycleAssignment_7 + // InternalComputation.g:944:2: ( rule__HWTargetDesign__OutputsPerCycleAssignment_7 ) + // InternalComputation.g:944:3: rule__HWTargetDesign__OutputsPerCycleAssignment_7 { pushFollow(FOLLOW_2); rule__HWTargetDesign__OutputsPerCycleAssignment_7(); @@ -2744,16 +2925,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__8" - // InternalComputation.g:900:1: rule__HWTargetDesign__Group__8 : rule__HWTargetDesign__Group__8__Impl rule__HWTargetDesign__Group__9 ; + // InternalComputation.g:952:1: rule__HWTargetDesign__Group__8 : rule__HWTargetDesign__Group__8__Impl rule__HWTargetDesign__Group__9 ; public final void rule__HWTargetDesign__Group__8() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:904:1: ( rule__HWTargetDesign__Group__8__Impl rule__HWTargetDesign__Group__9 ) - // InternalComputation.g:905:2: rule__HWTargetDesign__Group__8__Impl rule__HWTargetDesign__Group__9 + // InternalComputation.g:956:1: ( rule__HWTargetDesign__Group__8__Impl rule__HWTargetDesign__Group__9 ) + // InternalComputation.g:957:2: rule__HWTargetDesign__Group__8__Impl rule__HWTargetDesign__Group__9 { - pushFollow(FOLLOW_8); + pushFollow(FOLLOW_9); rule__HWTargetDesign__Group__8__Impl(); state._fsp--; @@ -2782,17 +2963,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__8__Impl" - // InternalComputation.g:912:1: rule__HWTargetDesign__Group__8__Impl : ( 'problemSize' ) ; + // InternalComputation.g:964:1: rule__HWTargetDesign__Group__8__Impl : ( 'problemSize' ) ; public final void rule__HWTargetDesign__Group__8__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:916:1: ( ( 'problemSize' ) ) - // InternalComputation.g:917:1: ( 'problemSize' ) + // InternalComputation.g:968:1: ( ( 'problemSize' ) ) + // InternalComputation.g:969:1: ( 'problemSize' ) { - // InternalComputation.g:917:1: ( 'problemSize' ) - // InternalComputation.g:918:2: 'problemSize' + // InternalComputation.g:969:1: ( 'problemSize' ) + // InternalComputation.g:970:2: 'problemSize' { before(grammarAccess.getHWTargetDesignAccess().getProblemSizeKeyword_8()); match(input,20,FOLLOW_2); @@ -2819,16 +3000,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__9" - // InternalComputation.g:927:1: rule__HWTargetDesign__Group__9 : rule__HWTargetDesign__Group__9__Impl rule__HWTargetDesign__Group__10 ; + // InternalComputation.g:979:1: rule__HWTargetDesign__Group__9 : rule__HWTargetDesign__Group__9__Impl rule__HWTargetDesign__Group__10 ; public final void rule__HWTargetDesign__Group__9() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:931:1: ( rule__HWTargetDesign__Group__9__Impl rule__HWTargetDesign__Group__10 ) - // InternalComputation.g:932:2: rule__HWTargetDesign__Group__9__Impl rule__HWTargetDesign__Group__10 + // InternalComputation.g:983:1: ( rule__HWTargetDesign__Group__9__Impl rule__HWTargetDesign__Group__10 ) + // InternalComputation.g:984:2: rule__HWTargetDesign__Group__9__Impl rule__HWTargetDesign__Group__10 { - pushFollow(FOLLOW_15); + pushFollow(FOLLOW_16); rule__HWTargetDesign__Group__9__Impl(); state._fsp--; @@ -2857,17 +3038,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__9__Impl" - // InternalComputation.g:939:1: rule__HWTargetDesign__Group__9__Impl : ( '=' ) ; + // InternalComputation.g:991:1: rule__HWTargetDesign__Group__9__Impl : ( '=' ) ; public final void rule__HWTargetDesign__Group__9__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:943:1: ( ( '=' ) ) - // InternalComputation.g:944:1: ( '=' ) + // InternalComputation.g:995:1: ( ( '=' ) ) + // InternalComputation.g:996:1: ( '=' ) { - // InternalComputation.g:944:1: ( '=' ) - // InternalComputation.g:945:2: '=' + // InternalComputation.g:996:1: ( '=' ) + // InternalComputation.g:997:2: '=' { before(grammarAccess.getHWTargetDesignAccess().getEqualsSignKeyword_9()); match(input,14,FOLLOW_2); @@ -2894,16 +3075,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__10" - // InternalComputation.g:954:1: rule__HWTargetDesign__Group__10 : rule__HWTargetDesign__Group__10__Impl rule__HWTargetDesign__Group__11 ; + // InternalComputation.g:1006:1: rule__HWTargetDesign__Group__10 : rule__HWTargetDesign__Group__10__Impl rule__HWTargetDesign__Group__11 ; public final void rule__HWTargetDesign__Group__10() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:958:1: ( rule__HWTargetDesign__Group__10__Impl rule__HWTargetDesign__Group__11 ) - // InternalComputation.g:959:2: rule__HWTargetDesign__Group__10__Impl rule__HWTargetDesign__Group__11 + // InternalComputation.g:1010:1: ( rule__HWTargetDesign__Group__10__Impl rule__HWTargetDesign__Group__11 ) + // InternalComputation.g:1011:2: rule__HWTargetDesign__Group__10__Impl rule__HWTargetDesign__Group__11 { - pushFollow(FOLLOW_16); + pushFollow(FOLLOW_17); rule__HWTargetDesign__Group__10__Impl(); state._fsp--; @@ -2932,21 +3113,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__Group__10__Impl" - // InternalComputation.g:966:1: rule__HWTargetDesign__Group__10__Impl : ( ( rule__HWTargetDesign__ProblemSizeExprAssignment_10 ) ) ; + // InternalComputation.g:1018:1: rule__HWTargetDesign__Group__10__Impl : ( ( rule__HWTargetDesign__ProblemSizeExprAssignment_10 ) ) ; public final void rule__HWTargetDesign__Group__10__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:970:1: ( ( ( rule__HWTargetDesign__ProblemSizeExprAssignment_10 ) ) ) - // InternalComputation.g:971:1: ( ( rule__HWTargetDesign__ProblemSizeExprAssignment_10 ) ) + // InternalComputation.g:1022:1: ( ( ( rule__HWTargetDesign__ProblemSizeExprAssignment_10 ) ) ) + // InternalComputation.g:1023:1: ( ( rule__HWTargetDesign__ProblemSizeExprAssignment_10 ) ) { - // InternalComputation.g:971:1: ( ( rule__HWTargetDesign__ProblemSizeExprAssignment_10 ) ) - // InternalComputation.g:972:2: ( rule__HWTargetDesign__ProblemSizeExprAssignment_10 ) + // InternalComputation.g:1023:1: ( ( rule__HWTargetDesign__ProblemSizeExprAssignment_10 ) ) + // InternalComputation.g:1024:2: ( rule__HWTargetDesign__ProblemSizeExprAssignment_10 ) { before(grammarAccess.getHWTargetDesignAccess().getProblemSizeExprAssignment_10()); - // InternalComputation.g:973:2: ( rule__HWTargetDesign__ProblemSizeExprAssignment_10 ) - // InternalComputation.g:973:3: rule__HWTargetDesign__ProblemSizeExprAssignment_10 + // InternalComputation.g:1025:2: ( rule__HWTargetDesign__ProblemSizeExprAssignment_10 ) + // InternalComputation.g:1025:3: rule__HWTargetDesign__ProblemSizeExprAssignment_10 { pushFollow(FOLLOW_2); rule__HWTargetDesign__ProblemSizeExprAssignment_10(); @@ -2954,9 +3135,647 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars state._fsp--; - } + } + + after(grammarAccess.getHWTargetDesignAccess().getProblemSizeExprAssignment_10()); + + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__HWTargetDesign__Group__10__Impl" + + + // $ANTLR start "rule__HWTargetDesign__Group__11" + // InternalComputation.g:1033:1: rule__HWTargetDesign__Group__11 : rule__HWTargetDesign__Group__11__Impl ; + public final void rule__HWTargetDesign__Group__11() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1037:1: ( rule__HWTargetDesign__Group__11__Impl ) + // InternalComputation.g:1038:2: rule__HWTargetDesign__Group__11__Impl + { + pushFollow(FOLLOW_2); + rule__HWTargetDesign__Group__11__Impl(); + + state._fsp--; + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__HWTargetDesign__Group__11" + + + // $ANTLR start "rule__HWTargetDesign__Group__11__Impl" + // InternalComputation.g:1044:1: rule__HWTargetDesign__Group__11__Impl : ( '}' ) ; + public final void rule__HWTargetDesign__Group__11__Impl() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1048:1: ( ( '}' ) ) + // InternalComputation.g:1049:1: ( '}' ) + { + // InternalComputation.g:1049:1: ( '}' ) + // InternalComputation.g:1050:2: '}' + { + before(grammarAccess.getHWTargetDesignAccess().getRightCurlyBracketKeyword_11()); + match(input,21,FOLLOW_2); + after(grammarAccess.getHWTargetDesignAccess().getRightCurlyBracketKeyword_11()); + + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__HWTargetDesign__Group__11__Impl" + + + // $ANTLR start "rule__BlockGroup__Group__0" + // InternalComputation.g:1060:1: rule__BlockGroup__Group__0 : rule__BlockGroup__Group__0__Impl rule__BlockGroup__Group__1 ; + public final void rule__BlockGroup__Group__0() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1064:1: ( rule__BlockGroup__Group__0__Impl rule__BlockGroup__Group__1 ) + // InternalComputation.g:1065:2: rule__BlockGroup__Group__0__Impl rule__BlockGroup__Group__1 + { + pushFollow(FOLLOW_8); + rule__BlockGroup__Group__0__Impl(); + + state._fsp--; + + pushFollow(FOLLOW_2); + rule__BlockGroup__Group__1(); + + state._fsp--; + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__Group__0" + + + // $ANTLR start "rule__BlockGroup__Group__0__Impl" + // InternalComputation.g:1072:1: rule__BlockGroup__Group__0__Impl : ( 'group' ) ; + public final void rule__BlockGroup__Group__0__Impl() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1076:1: ( ( 'group' ) ) + // InternalComputation.g:1077:1: ( 'group' ) + { + // InternalComputation.g:1077:1: ( 'group' ) + // InternalComputation.g:1078:2: 'group' + { + before(grammarAccess.getBlockGroupAccess().getGroupKeyword_0()); + match(input,22,FOLLOW_2); + after(grammarAccess.getBlockGroupAccess().getGroupKeyword_0()); + + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__Group__0__Impl" + + + // $ANTLR start "rule__BlockGroup__Group__1" + // InternalComputation.g:1087:1: rule__BlockGroup__Group__1 : rule__BlockGroup__Group__1__Impl rule__BlockGroup__Group__2 ; + public final void rule__BlockGroup__Group__1() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1091:1: ( rule__BlockGroup__Group__1__Impl rule__BlockGroup__Group__2 ) + // InternalComputation.g:1092:2: rule__BlockGroup__Group__1__Impl rule__BlockGroup__Group__2 + { + pushFollow(FOLLOW_12); + rule__BlockGroup__Group__1__Impl(); + + state._fsp--; + + pushFollow(FOLLOW_2); + rule__BlockGroup__Group__2(); + + state._fsp--; + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__Group__1" + + + // $ANTLR start "rule__BlockGroup__Group__1__Impl" + // InternalComputation.g:1099:1: rule__BlockGroup__Group__1__Impl : ( ( rule__BlockGroup__NameAssignment_1 ) ) ; + public final void rule__BlockGroup__Group__1__Impl() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1103:1: ( ( ( rule__BlockGroup__NameAssignment_1 ) ) ) + // InternalComputation.g:1104:1: ( ( rule__BlockGroup__NameAssignment_1 ) ) + { + // InternalComputation.g:1104:1: ( ( rule__BlockGroup__NameAssignment_1 ) ) + // InternalComputation.g:1105:2: ( rule__BlockGroup__NameAssignment_1 ) + { + before(grammarAccess.getBlockGroupAccess().getNameAssignment_1()); + // InternalComputation.g:1106:2: ( rule__BlockGroup__NameAssignment_1 ) + // InternalComputation.g:1106:3: rule__BlockGroup__NameAssignment_1 + { + pushFollow(FOLLOW_2); + rule__BlockGroup__NameAssignment_1(); + + state._fsp--; + + + } + + after(grammarAccess.getBlockGroupAccess().getNameAssignment_1()); + + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__Group__1__Impl" + + + // $ANTLR start "rule__BlockGroup__Group__2" + // InternalComputation.g:1114:1: rule__BlockGroup__Group__2 : rule__BlockGroup__Group__2__Impl rule__BlockGroup__Group__3 ; + public final void rule__BlockGroup__Group__2() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1118:1: ( rule__BlockGroup__Group__2__Impl rule__BlockGroup__Group__3 ) + // InternalComputation.g:1119:2: rule__BlockGroup__Group__2__Impl rule__BlockGroup__Group__3 + { + pushFollow(FOLLOW_8); + rule__BlockGroup__Group__2__Impl(); + + state._fsp--; + + pushFollow(FOLLOW_2); + rule__BlockGroup__Group__3(); + + state._fsp--; + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__Group__2" + + + // $ANTLR start "rule__BlockGroup__Group__2__Impl" + // InternalComputation.g:1126:1: rule__BlockGroup__Group__2__Impl : ( '{' ) ; + public final void rule__BlockGroup__Group__2__Impl() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1130:1: ( ( '{' ) ) + // InternalComputation.g:1131:1: ( '{' ) + { + // InternalComputation.g:1131:1: ( '{' ) + // InternalComputation.g:1132:2: '{' + { + before(grammarAccess.getBlockGroupAccess().getLeftCurlyBracketKeyword_2()); + match(input,17,FOLLOW_2); + after(grammarAccess.getBlockGroupAccess().getLeftCurlyBracketKeyword_2()); + + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__Group__2__Impl" + + + // $ANTLR start "rule__BlockGroup__Group__3" + // InternalComputation.g:1141:1: rule__BlockGroup__Group__3 : rule__BlockGroup__Group__3__Impl rule__BlockGroup__Group__4 ; + public final void rule__BlockGroup__Group__3() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1145:1: ( rule__BlockGroup__Group__3__Impl rule__BlockGroup__Group__4 ) + // InternalComputation.g:1146:2: rule__BlockGroup__Group__3__Impl rule__BlockGroup__Group__4 + { + pushFollow(FOLLOW_18); + rule__BlockGroup__Group__3__Impl(); + + state._fsp--; + + pushFollow(FOLLOW_2); + rule__BlockGroup__Group__4(); + + state._fsp--; + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__Group__3" + + + // $ANTLR start "rule__BlockGroup__Group__3__Impl" + // InternalComputation.g:1153:1: rule__BlockGroup__Group__3__Impl : ( ( rule__BlockGroup__BlocksAssignment_3 ) ) ; + public final void rule__BlockGroup__Group__3__Impl() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1157:1: ( ( ( rule__BlockGroup__BlocksAssignment_3 ) ) ) + // InternalComputation.g:1158:1: ( ( rule__BlockGroup__BlocksAssignment_3 ) ) + { + // InternalComputation.g:1158:1: ( ( rule__BlockGroup__BlocksAssignment_3 ) ) + // InternalComputation.g:1159:2: ( rule__BlockGroup__BlocksAssignment_3 ) + { + before(grammarAccess.getBlockGroupAccess().getBlocksAssignment_3()); + // InternalComputation.g:1160:2: ( rule__BlockGroup__BlocksAssignment_3 ) + // InternalComputation.g:1160:3: rule__BlockGroup__BlocksAssignment_3 + { + pushFollow(FOLLOW_2); + rule__BlockGroup__BlocksAssignment_3(); + + state._fsp--; + + + } + + after(grammarAccess.getBlockGroupAccess().getBlocksAssignment_3()); + + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__Group__3__Impl" + + + // $ANTLR start "rule__BlockGroup__Group__4" + // InternalComputation.g:1168:1: rule__BlockGroup__Group__4 : rule__BlockGroup__Group__4__Impl rule__BlockGroup__Group__5 ; + public final void rule__BlockGroup__Group__4() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1172:1: ( rule__BlockGroup__Group__4__Impl rule__BlockGroup__Group__5 ) + // InternalComputation.g:1173:2: rule__BlockGroup__Group__4__Impl rule__BlockGroup__Group__5 + { + pushFollow(FOLLOW_18); + rule__BlockGroup__Group__4__Impl(); + + state._fsp--; + + pushFollow(FOLLOW_2); + rule__BlockGroup__Group__5(); + + state._fsp--; + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__Group__4" + + + // $ANTLR start "rule__BlockGroup__Group__4__Impl" + // InternalComputation.g:1180:1: rule__BlockGroup__Group__4__Impl : ( ( rule__BlockGroup__Group_4__0 )* ) ; + public final void rule__BlockGroup__Group__4__Impl() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1184:1: ( ( ( rule__BlockGroup__Group_4__0 )* ) ) + // InternalComputation.g:1185:1: ( ( rule__BlockGroup__Group_4__0 )* ) + { + // InternalComputation.g:1185:1: ( ( rule__BlockGroup__Group_4__0 )* ) + // InternalComputation.g:1186:2: ( rule__BlockGroup__Group_4__0 )* + { + before(grammarAccess.getBlockGroupAccess().getGroup_4()); + // InternalComputation.g:1187:2: ( rule__BlockGroup__Group_4__0 )* + loop8: + do { + int alt8=2; + int LA8_0 = input.LA(1); + + if ( (LA8_0==23) ) { + alt8=1; + } + + + switch (alt8) { + case 1 : + // InternalComputation.g:1187:3: rule__BlockGroup__Group_4__0 + { + pushFollow(FOLLOW_19); + rule__BlockGroup__Group_4__0(); + + state._fsp--; + + + } + break; + + default : + break loop8; + } + } while (true); + + after(grammarAccess.getBlockGroupAccess().getGroup_4()); + + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__Group__4__Impl" + + + // $ANTLR start "rule__BlockGroup__Group__5" + // InternalComputation.g:1195:1: rule__BlockGroup__Group__5 : rule__BlockGroup__Group__5__Impl ; + public final void rule__BlockGroup__Group__5() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1199:1: ( rule__BlockGroup__Group__5__Impl ) + // InternalComputation.g:1200:2: rule__BlockGroup__Group__5__Impl + { + pushFollow(FOLLOW_2); + rule__BlockGroup__Group__5__Impl(); + + state._fsp--; + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__Group__5" + + + // $ANTLR start "rule__BlockGroup__Group__5__Impl" + // InternalComputation.g:1206:1: rule__BlockGroup__Group__5__Impl : ( '}' ) ; + public final void rule__BlockGroup__Group__5__Impl() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1210:1: ( ( '}' ) ) + // InternalComputation.g:1211:1: ( '}' ) + { + // InternalComputation.g:1211:1: ( '}' ) + // InternalComputation.g:1212:2: '}' + { + before(grammarAccess.getBlockGroupAccess().getRightCurlyBracketKeyword_5()); + match(input,21,FOLLOW_2); + after(grammarAccess.getBlockGroupAccess().getRightCurlyBracketKeyword_5()); + + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__Group__5__Impl" + + + // $ANTLR start "rule__BlockGroup__Group_4__0" + // InternalComputation.g:1222:1: rule__BlockGroup__Group_4__0 : rule__BlockGroup__Group_4__0__Impl rule__BlockGroup__Group_4__1 ; + public final void rule__BlockGroup__Group_4__0() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1226:1: ( rule__BlockGroup__Group_4__0__Impl rule__BlockGroup__Group_4__1 ) + // InternalComputation.g:1227:2: rule__BlockGroup__Group_4__0__Impl rule__BlockGroup__Group_4__1 + { + pushFollow(FOLLOW_8); + rule__BlockGroup__Group_4__0__Impl(); + + state._fsp--; + + pushFollow(FOLLOW_2); + rule__BlockGroup__Group_4__1(); + + state._fsp--; + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__Group_4__0" + + + // $ANTLR start "rule__BlockGroup__Group_4__0__Impl" + // InternalComputation.g:1234:1: rule__BlockGroup__Group_4__0__Impl : ( ',' ) ; + public final void rule__BlockGroup__Group_4__0__Impl() throws RecognitionException { - after(grammarAccess.getHWTargetDesignAccess().getProblemSizeExprAssignment_10()); + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:1238:1: ( ( ',' ) ) + // InternalComputation.g:1239:1: ( ',' ) + { + // InternalComputation.g:1239:1: ( ',' ) + // InternalComputation.g:1240:2: ',' + { + before(grammarAccess.getBlockGroupAccess().getCommaKeyword_4_0()); + match(input,23,FOLLOW_2); + after(grammarAccess.getBlockGroupAccess().getCommaKeyword_4_0()); } @@ -2975,21 +3794,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } return ; } - // $ANTLR end "rule__HWTargetDesign__Group__10__Impl" + // $ANTLR end "rule__BlockGroup__Group_4__0__Impl" - // $ANTLR start "rule__HWTargetDesign__Group__11" - // InternalComputation.g:981:1: rule__HWTargetDesign__Group__11 : rule__HWTargetDesign__Group__11__Impl ; - public final void rule__HWTargetDesign__Group__11() throws RecognitionException { + // $ANTLR start "rule__BlockGroup__Group_4__1" + // InternalComputation.g:1249:1: rule__BlockGroup__Group_4__1 : rule__BlockGroup__Group_4__1__Impl ; + public final void rule__BlockGroup__Group_4__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:985:1: ( rule__HWTargetDesign__Group__11__Impl ) - // InternalComputation.g:986:2: rule__HWTargetDesign__Group__11__Impl + // InternalComputation.g:1253:1: ( rule__BlockGroup__Group_4__1__Impl ) + // InternalComputation.g:1254:2: rule__BlockGroup__Group_4__1__Impl { pushFollow(FOLLOW_2); - rule__HWTargetDesign__Group__11__Impl(); + rule__BlockGroup__Group_4__1__Impl(); state._fsp--; @@ -3008,25 +3827,35 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } return ; } - // $ANTLR end "rule__HWTargetDesign__Group__11" + // $ANTLR end "rule__BlockGroup__Group_4__1" - // $ANTLR start "rule__HWTargetDesign__Group__11__Impl" - // InternalComputation.g:992:1: rule__HWTargetDesign__Group__11__Impl : ( '}' ) ; - public final void rule__HWTargetDesign__Group__11__Impl() throws RecognitionException { + // $ANTLR start "rule__BlockGroup__Group_4__1__Impl" + // InternalComputation.g:1260:1: rule__BlockGroup__Group_4__1__Impl : ( ( rule__BlockGroup__BlocksAssignment_4_1 ) ) ; + public final void rule__BlockGroup__Group_4__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:996:1: ( ( '}' ) ) - // InternalComputation.g:997:1: ( '}' ) + // InternalComputation.g:1264:1: ( ( ( rule__BlockGroup__BlocksAssignment_4_1 ) ) ) + // InternalComputation.g:1265:1: ( ( rule__BlockGroup__BlocksAssignment_4_1 ) ) { - // InternalComputation.g:997:1: ( '}' ) - // InternalComputation.g:998:2: '}' + // InternalComputation.g:1265:1: ( ( rule__BlockGroup__BlocksAssignment_4_1 ) ) + // InternalComputation.g:1266:2: ( rule__BlockGroup__BlocksAssignment_4_1 ) { - before(grammarAccess.getHWTargetDesignAccess().getRightCurlyBracketKeyword_11()); - match(input,21,FOLLOW_2); - after(grammarAccess.getHWTargetDesignAccess().getRightCurlyBracketKeyword_11()); + before(grammarAccess.getBlockGroupAccess().getBlocksAssignment_4_1()); + // InternalComputation.g:1267:2: ( rule__BlockGroup__BlocksAssignment_4_1 ) + // InternalComputation.g:1267:3: rule__BlockGroup__BlocksAssignment_4_1 + { + pushFollow(FOLLOW_2); + rule__BlockGroup__BlocksAssignment_4_1(); + + state._fsp--; + + + } + + after(grammarAccess.getBlockGroupAccess().getBlocksAssignment_4_1()); } @@ -3045,20 +3874,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } return ; } - // $ANTLR end "rule__HWTargetDesign__Group__11__Impl" + // $ANTLR end "rule__BlockGroup__Group_4__1__Impl" // $ANTLR start "rule__ComputationBlock__Group__0" - // InternalComputation.g:1008:1: rule__ComputationBlock__Group__0 : rule__ComputationBlock__Group__0__Impl rule__ComputationBlock__Group__1 ; + // InternalComputation.g:1276:1: rule__ComputationBlock__Group__0 : rule__ComputationBlock__Group__0__Impl rule__ComputationBlock__Group__1 ; public final void rule__ComputationBlock__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1012:1: ( rule__ComputationBlock__Group__0__Impl rule__ComputationBlock__Group__1 ) - // InternalComputation.g:1013:2: rule__ComputationBlock__Group__0__Impl rule__ComputationBlock__Group__1 + // InternalComputation.g:1280:1: ( rule__ComputationBlock__Group__0__Impl rule__ComputationBlock__Group__1 ) + // InternalComputation.g:1281:2: rule__ComputationBlock__Group__0__Impl rule__ComputationBlock__Group__1 { - pushFollow(FOLLOW_7); + pushFollow(FOLLOW_8); rule__ComputationBlock__Group__0__Impl(); state._fsp--; @@ -3087,20 +3916,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationBlock__Group__0__Impl" - // InternalComputation.g:1020:1: rule__ComputationBlock__Group__0__Impl : ( 'block' ) ; + // InternalComputation.g:1288:1: rule__ComputationBlock__Group__0__Impl : ( 'block' ) ; public final void rule__ComputationBlock__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1024:1: ( ( 'block' ) ) - // InternalComputation.g:1025:1: ( 'block' ) + // InternalComputation.g:1292:1: ( ( 'block' ) ) + // InternalComputation.g:1293:1: ( 'block' ) { - // InternalComputation.g:1025:1: ( 'block' ) - // InternalComputation.g:1026:2: 'block' + // InternalComputation.g:1293:1: ( 'block' ) + // InternalComputation.g:1294:2: 'block' { before(grammarAccess.getComputationBlockAccess().getBlockKeyword_0()); - match(input,22,FOLLOW_2); + match(input,24,FOLLOW_2); after(grammarAccess.getComputationBlockAccess().getBlockKeyword_0()); } @@ -3124,16 +3953,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationBlock__Group__1" - // InternalComputation.g:1035:1: rule__ComputationBlock__Group__1 : rule__ComputationBlock__Group__1__Impl rule__ComputationBlock__Group__2 ; + // InternalComputation.g:1303:1: rule__ComputationBlock__Group__1 : rule__ComputationBlock__Group__1__Impl rule__ComputationBlock__Group__2 ; public final void rule__ComputationBlock__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1039:1: ( rule__ComputationBlock__Group__1__Impl rule__ComputationBlock__Group__2 ) - // InternalComputation.g:1040:2: rule__ComputationBlock__Group__1__Impl rule__ComputationBlock__Group__2 + // InternalComputation.g:1307:1: ( rule__ComputationBlock__Group__1__Impl rule__ComputationBlock__Group__2 ) + // InternalComputation.g:1308:2: rule__ComputationBlock__Group__1__Impl rule__ComputationBlock__Group__2 { - pushFollow(FOLLOW_11); + pushFollow(FOLLOW_12); rule__ComputationBlock__Group__1__Impl(); state._fsp--; @@ -3162,21 +3991,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationBlock__Group__1__Impl" - // InternalComputation.g:1047:1: rule__ComputationBlock__Group__1__Impl : ( ( rule__ComputationBlock__NameAssignment_1 ) ) ; + // InternalComputation.g:1315:1: rule__ComputationBlock__Group__1__Impl : ( ( rule__ComputationBlock__NameAssignment_1 ) ) ; public final void rule__ComputationBlock__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1051:1: ( ( ( rule__ComputationBlock__NameAssignment_1 ) ) ) - // InternalComputation.g:1052:1: ( ( rule__ComputationBlock__NameAssignment_1 ) ) + // InternalComputation.g:1319:1: ( ( ( rule__ComputationBlock__NameAssignment_1 ) ) ) + // InternalComputation.g:1320:1: ( ( rule__ComputationBlock__NameAssignment_1 ) ) { - // InternalComputation.g:1052:1: ( ( rule__ComputationBlock__NameAssignment_1 ) ) - // InternalComputation.g:1053:2: ( rule__ComputationBlock__NameAssignment_1 ) + // InternalComputation.g:1320:1: ( ( rule__ComputationBlock__NameAssignment_1 ) ) + // InternalComputation.g:1321:2: ( rule__ComputationBlock__NameAssignment_1 ) { before(grammarAccess.getComputationBlockAccess().getNameAssignment_1()); - // InternalComputation.g:1054:2: ( rule__ComputationBlock__NameAssignment_1 ) - // InternalComputation.g:1054:3: rule__ComputationBlock__NameAssignment_1 + // InternalComputation.g:1322:2: ( rule__ComputationBlock__NameAssignment_1 ) + // InternalComputation.g:1322:3: rule__ComputationBlock__NameAssignment_1 { pushFollow(FOLLOW_2); rule__ComputationBlock__NameAssignment_1(); @@ -3209,16 +4038,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationBlock__Group__2" - // InternalComputation.g:1062:1: rule__ComputationBlock__Group__2 : rule__ComputationBlock__Group__2__Impl rule__ComputationBlock__Group__3 ; + // InternalComputation.g:1330:1: rule__ComputationBlock__Group__2 : rule__ComputationBlock__Group__2__Impl rule__ComputationBlock__Group__3 ; public final void rule__ComputationBlock__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1066:1: ( rule__ComputationBlock__Group__2__Impl rule__ComputationBlock__Group__3 ) - // InternalComputation.g:1067:2: rule__ComputationBlock__Group__2__Impl rule__ComputationBlock__Group__3 + // InternalComputation.g:1334:1: ( rule__ComputationBlock__Group__2__Impl rule__ComputationBlock__Group__3 ) + // InternalComputation.g:1335:2: rule__ComputationBlock__Group__2__Impl rule__ComputationBlock__Group__3 { - pushFollow(FOLLOW_17); + pushFollow(FOLLOW_20); rule__ComputationBlock__Group__2__Impl(); state._fsp--; @@ -3247,17 +4076,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationBlock__Group__2__Impl" - // InternalComputation.g:1074:1: rule__ComputationBlock__Group__2__Impl : ( '{' ) ; + // InternalComputation.g:1342:1: rule__ComputationBlock__Group__2__Impl : ( '{' ) ; public final void rule__ComputationBlock__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1078:1: ( ( '{' ) ) - // InternalComputation.g:1079:1: ( '{' ) + // InternalComputation.g:1346:1: ( ( '{' ) ) + // InternalComputation.g:1347:1: ( '{' ) { - // InternalComputation.g:1079:1: ( '{' ) - // InternalComputation.g:1080:2: '{' + // InternalComputation.g:1347:1: ( '{' ) + // InternalComputation.g:1348:2: '{' { before(grammarAccess.getComputationBlockAccess().getLeftCurlyBracketKeyword_2()); match(input,17,FOLLOW_2); @@ -3284,16 +4113,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationBlock__Group__3" - // InternalComputation.g:1089:1: rule__ComputationBlock__Group__3 : rule__ComputationBlock__Group__3__Impl rule__ComputationBlock__Group__4 ; + // InternalComputation.g:1357:1: rule__ComputationBlock__Group__3 : rule__ComputationBlock__Group__3__Impl rule__ComputationBlock__Group__4 ; public final void rule__ComputationBlock__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1093:1: ( rule__ComputationBlock__Group__3__Impl rule__ComputationBlock__Group__4 ) - // InternalComputation.g:1094:2: rule__ComputationBlock__Group__3__Impl rule__ComputationBlock__Group__4 + // InternalComputation.g:1361:1: ( rule__ComputationBlock__Group__3__Impl rule__ComputationBlock__Group__4 ) + // InternalComputation.g:1362:2: rule__ComputationBlock__Group__3__Impl rule__ComputationBlock__Group__4 { - pushFollow(FOLLOW_16); + pushFollow(FOLLOW_17); rule__ComputationBlock__Group__3__Impl(); state._fsp--; @@ -3322,26 +4151,26 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationBlock__Group__3__Impl" - // InternalComputation.g:1101:1: rule__ComputationBlock__Group__3__Impl : ( ( ( rule__ComputationBlock__OperationsAssignment_3 ) ) ( ( rule__ComputationBlock__OperationsAssignment_3 )* ) ) ; + // InternalComputation.g:1369:1: rule__ComputationBlock__Group__3__Impl : ( ( ( rule__ComputationBlock__OperationsAssignment_3 ) ) ( ( rule__ComputationBlock__OperationsAssignment_3 )* ) ) ; public final void rule__ComputationBlock__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1105:1: ( ( ( ( rule__ComputationBlock__OperationsAssignment_3 ) ) ( ( rule__ComputationBlock__OperationsAssignment_3 )* ) ) ) - // InternalComputation.g:1106:1: ( ( ( rule__ComputationBlock__OperationsAssignment_3 ) ) ( ( rule__ComputationBlock__OperationsAssignment_3 )* ) ) + // InternalComputation.g:1373:1: ( ( ( ( rule__ComputationBlock__OperationsAssignment_3 ) ) ( ( rule__ComputationBlock__OperationsAssignment_3 )* ) ) ) + // InternalComputation.g:1374:1: ( ( ( rule__ComputationBlock__OperationsAssignment_3 ) ) ( ( rule__ComputationBlock__OperationsAssignment_3 )* ) ) { - // InternalComputation.g:1106:1: ( ( ( rule__ComputationBlock__OperationsAssignment_3 ) ) ( ( rule__ComputationBlock__OperationsAssignment_3 )* ) ) - // InternalComputation.g:1107:2: ( ( rule__ComputationBlock__OperationsAssignment_3 ) ) ( ( rule__ComputationBlock__OperationsAssignment_3 )* ) + // InternalComputation.g:1374:1: ( ( ( rule__ComputationBlock__OperationsAssignment_3 ) ) ( ( rule__ComputationBlock__OperationsAssignment_3 )* ) ) + // InternalComputation.g:1375:2: ( ( rule__ComputationBlock__OperationsAssignment_3 ) ) ( ( rule__ComputationBlock__OperationsAssignment_3 )* ) { - // InternalComputation.g:1107:2: ( ( rule__ComputationBlock__OperationsAssignment_3 ) ) - // InternalComputation.g:1108:3: ( rule__ComputationBlock__OperationsAssignment_3 ) + // InternalComputation.g:1375:2: ( ( rule__ComputationBlock__OperationsAssignment_3 ) ) + // InternalComputation.g:1376:3: ( rule__ComputationBlock__OperationsAssignment_3 ) { before(grammarAccess.getComputationBlockAccess().getOperationsAssignment_3()); - // InternalComputation.g:1109:3: ( rule__ComputationBlock__OperationsAssignment_3 ) - // InternalComputation.g:1109:4: rule__ComputationBlock__OperationsAssignment_3 + // InternalComputation.g:1377:3: ( rule__ComputationBlock__OperationsAssignment_3 ) + // InternalComputation.g:1377:4: rule__ComputationBlock__OperationsAssignment_3 { - pushFollow(FOLLOW_18); + pushFollow(FOLLOW_21); rule__ComputationBlock__OperationsAssignment_3(); state._fsp--; @@ -3353,26 +4182,26 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } - // InternalComputation.g:1112:2: ( ( rule__ComputationBlock__OperationsAssignment_3 )* ) - // InternalComputation.g:1113:3: ( rule__ComputationBlock__OperationsAssignment_3 )* + // InternalComputation.g:1380:2: ( ( rule__ComputationBlock__OperationsAssignment_3 )* ) + // InternalComputation.g:1381:3: ( rule__ComputationBlock__OperationsAssignment_3 )* { before(grammarAccess.getComputationBlockAccess().getOperationsAssignment_3()); - // InternalComputation.g:1114:3: ( rule__ComputationBlock__OperationsAssignment_3 )* - loop7: + // InternalComputation.g:1382:3: ( rule__ComputationBlock__OperationsAssignment_3 )* + loop9: do { - int alt7=2; - int LA7_0 = input.LA(1); + int alt9=2; + int LA9_0 = input.LA(1); - if ( ((LA7_0>=11 && LA7_0<=12)) ) { - alt7=1; + if ( ((LA9_0>=11 && LA9_0<=12)) ) { + alt9=1; } - switch (alt7) { + switch (alt9) { case 1 : - // InternalComputation.g:1114:4: rule__ComputationBlock__OperationsAssignment_3 + // InternalComputation.g:1382:4: rule__ComputationBlock__OperationsAssignment_3 { - pushFollow(FOLLOW_18); + pushFollow(FOLLOW_21); rule__ComputationBlock__OperationsAssignment_3(); state._fsp--; @@ -3382,7 +4211,7 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars break; default : - break loop7; + break loop9; } } while (true); @@ -3412,14 +4241,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationBlock__Group__4" - // InternalComputation.g:1123:1: rule__ComputationBlock__Group__4 : rule__ComputationBlock__Group__4__Impl ; + // InternalComputation.g:1391:1: rule__ComputationBlock__Group__4 : rule__ComputationBlock__Group__4__Impl ; public final void rule__ComputationBlock__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1127:1: ( rule__ComputationBlock__Group__4__Impl ) - // InternalComputation.g:1128:2: rule__ComputationBlock__Group__4__Impl + // InternalComputation.g:1395:1: ( rule__ComputationBlock__Group__4__Impl ) + // InternalComputation.g:1396:2: rule__ComputationBlock__Group__4__Impl { pushFollow(FOLLOW_2); rule__ComputationBlock__Group__4__Impl(); @@ -3445,17 +4274,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationBlock__Group__4__Impl" - // InternalComputation.g:1134:1: rule__ComputationBlock__Group__4__Impl : ( '}' ) ; + // InternalComputation.g:1402:1: rule__ComputationBlock__Group__4__Impl : ( '}' ) ; public final void rule__ComputationBlock__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1138:1: ( ( '}' ) ) - // InternalComputation.g:1139:1: ( '}' ) + // InternalComputation.g:1406:1: ( ( '}' ) ) + // InternalComputation.g:1407:1: ( '}' ) { - // InternalComputation.g:1139:1: ( '}' ) - // InternalComputation.g:1140:2: '}' + // InternalComputation.g:1407:1: ( '}' ) + // InternalComputation.g:1408:2: '}' { before(grammarAccess.getComputationBlockAccess().getRightCurlyBracketKeyword_4()); match(input,21,FOLLOW_2); @@ -3482,16 +4311,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__0" - // InternalComputation.g:1150:1: rule__Operation__Group__0 : rule__Operation__Group__0__Impl rule__Operation__Group__1 ; + // InternalComputation.g:1418:1: rule__Operation__Group__0 : rule__Operation__Group__0__Impl rule__Operation__Group__1 ; public final void rule__Operation__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1154:1: ( rule__Operation__Group__0__Impl rule__Operation__Group__1 ) - // InternalComputation.g:1155:2: rule__Operation__Group__0__Impl rule__Operation__Group__1 + // InternalComputation.g:1422:1: ( rule__Operation__Group__0__Impl rule__Operation__Group__1 ) + // InternalComputation.g:1423:2: rule__Operation__Group__0__Impl rule__Operation__Group__1 { - pushFollow(FOLLOW_19); + pushFollow(FOLLOW_22); rule__Operation__Group__0__Impl(); state._fsp--; @@ -3520,21 +4349,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__0__Impl" - // InternalComputation.g:1162:1: rule__Operation__Group__0__Impl : ( ( rule__Operation__OpTypeAssignment_0 ) ) ; + // InternalComputation.g:1430:1: rule__Operation__Group__0__Impl : ( ( rule__Operation__OpTypeAssignment_0 ) ) ; public final void rule__Operation__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1166:1: ( ( ( rule__Operation__OpTypeAssignment_0 ) ) ) - // InternalComputation.g:1167:1: ( ( rule__Operation__OpTypeAssignment_0 ) ) + // InternalComputation.g:1434:1: ( ( ( rule__Operation__OpTypeAssignment_0 ) ) ) + // InternalComputation.g:1435:1: ( ( rule__Operation__OpTypeAssignment_0 ) ) { - // InternalComputation.g:1167:1: ( ( rule__Operation__OpTypeAssignment_0 ) ) - // InternalComputation.g:1168:2: ( rule__Operation__OpTypeAssignment_0 ) + // InternalComputation.g:1435:1: ( ( rule__Operation__OpTypeAssignment_0 ) ) + // InternalComputation.g:1436:2: ( rule__Operation__OpTypeAssignment_0 ) { before(grammarAccess.getOperationAccess().getOpTypeAssignment_0()); - // InternalComputation.g:1169:2: ( rule__Operation__OpTypeAssignment_0 ) - // InternalComputation.g:1169:3: rule__Operation__OpTypeAssignment_0 + // InternalComputation.g:1437:2: ( rule__Operation__OpTypeAssignment_0 ) + // InternalComputation.g:1437:3: rule__Operation__OpTypeAssignment_0 { pushFollow(FOLLOW_2); rule__Operation__OpTypeAssignment_0(); @@ -3567,16 +4396,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__1" - // InternalComputation.g:1177:1: rule__Operation__Group__1 : rule__Operation__Group__1__Impl rule__Operation__Group__2 ; + // InternalComputation.g:1445:1: rule__Operation__Group__1 : rule__Operation__Group__1__Impl rule__Operation__Group__2 ; public final void rule__Operation__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1181:1: ( rule__Operation__Group__1__Impl rule__Operation__Group__2 ) - // InternalComputation.g:1182:2: rule__Operation__Group__1__Impl rule__Operation__Group__2 + // InternalComputation.g:1449:1: ( rule__Operation__Group__1__Impl rule__Operation__Group__2 ) + // InternalComputation.g:1450:2: rule__Operation__Group__1__Impl rule__Operation__Group__2 { - pushFollow(FOLLOW_20); + pushFollow(FOLLOW_23); rule__Operation__Group__1__Impl(); state._fsp--; @@ -3605,20 +4434,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__1__Impl" - // InternalComputation.g:1189:1: rule__Operation__Group__1__Impl : ( ':' ) ; + // InternalComputation.g:1457:1: rule__Operation__Group__1__Impl : ( ':' ) ; public final void rule__Operation__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1193:1: ( ( ':' ) ) - // InternalComputation.g:1194:1: ( ':' ) + // InternalComputation.g:1461:1: ( ( ':' ) ) + // InternalComputation.g:1462:1: ( ':' ) { - // InternalComputation.g:1194:1: ( ':' ) - // InternalComputation.g:1195:2: ':' + // InternalComputation.g:1462:1: ( ':' ) + // InternalComputation.g:1463:2: ':' { before(grammarAccess.getOperationAccess().getColonKeyword_1()); - match(input,23,FOLLOW_2); + match(input,25,FOLLOW_2); after(grammarAccess.getOperationAccess().getColonKeyword_1()); } @@ -3642,16 +4471,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__2" - // InternalComputation.g:1204:1: rule__Operation__Group__2 : rule__Operation__Group__2__Impl rule__Operation__Group__3 ; + // InternalComputation.g:1472:1: rule__Operation__Group__2 : rule__Operation__Group__2__Impl rule__Operation__Group__3 ; public final void rule__Operation__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1208:1: ( rule__Operation__Group__2__Impl rule__Operation__Group__3 ) - // InternalComputation.g:1209:2: rule__Operation__Group__2__Impl rule__Operation__Group__3 + // InternalComputation.g:1476:1: ( rule__Operation__Group__2__Impl rule__Operation__Group__3 ) + // InternalComputation.g:1477:2: rule__Operation__Group__2__Impl rule__Operation__Group__3 { - pushFollow(FOLLOW_8); + pushFollow(FOLLOW_9); rule__Operation__Group__2__Impl(); state._fsp--; @@ -3680,21 +4509,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__2__Impl" - // InternalComputation.g:1216:1: rule__Operation__Group__2__Impl : ( ( rule__Operation__OutputExprAssignment_2 ) ) ; + // InternalComputation.g:1484:1: rule__Operation__Group__2__Impl : ( ( rule__Operation__OutputExprAssignment_2 ) ) ; public final void rule__Operation__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1220:1: ( ( ( rule__Operation__OutputExprAssignment_2 ) ) ) - // InternalComputation.g:1221:1: ( ( rule__Operation__OutputExprAssignment_2 ) ) + // InternalComputation.g:1488:1: ( ( ( rule__Operation__OutputExprAssignment_2 ) ) ) + // InternalComputation.g:1489:1: ( ( rule__Operation__OutputExprAssignment_2 ) ) { - // InternalComputation.g:1221:1: ( ( rule__Operation__OutputExprAssignment_2 ) ) - // InternalComputation.g:1222:2: ( rule__Operation__OutputExprAssignment_2 ) + // InternalComputation.g:1489:1: ( ( rule__Operation__OutputExprAssignment_2 ) ) + // InternalComputation.g:1490:2: ( rule__Operation__OutputExprAssignment_2 ) { before(grammarAccess.getOperationAccess().getOutputExprAssignment_2()); - // InternalComputation.g:1223:2: ( rule__Operation__OutputExprAssignment_2 ) - // InternalComputation.g:1223:3: rule__Operation__OutputExprAssignment_2 + // InternalComputation.g:1491:2: ( rule__Operation__OutputExprAssignment_2 ) + // InternalComputation.g:1491:3: rule__Operation__OutputExprAssignment_2 { pushFollow(FOLLOW_2); rule__Operation__OutputExprAssignment_2(); @@ -3727,16 +4556,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__3" - // InternalComputation.g:1231:1: rule__Operation__Group__3 : rule__Operation__Group__3__Impl rule__Operation__Group__4 ; + // InternalComputation.g:1499:1: rule__Operation__Group__3 : rule__Operation__Group__3__Impl rule__Operation__Group__4 ; public final void rule__Operation__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1235:1: ( rule__Operation__Group__3__Impl rule__Operation__Group__4 ) - // InternalComputation.g:1236:2: rule__Operation__Group__3__Impl rule__Operation__Group__4 + // InternalComputation.g:1503:1: ( rule__Operation__Group__3__Impl rule__Operation__Group__4 ) + // InternalComputation.g:1504:2: rule__Operation__Group__3__Impl rule__Operation__Group__4 { - pushFollow(FOLLOW_20); + pushFollow(FOLLOW_23); rule__Operation__Group__3__Impl(); state._fsp--; @@ -3765,17 +4594,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__3__Impl" - // InternalComputation.g:1243:1: rule__Operation__Group__3__Impl : ( '=' ) ; + // InternalComputation.g:1511:1: rule__Operation__Group__3__Impl : ( '=' ) ; public final void rule__Operation__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1247:1: ( ( '=' ) ) - // InternalComputation.g:1248:1: ( '=' ) + // InternalComputation.g:1515:1: ( ( '=' ) ) + // InternalComputation.g:1516:1: ( '=' ) { - // InternalComputation.g:1248:1: ( '=' ) - // InternalComputation.g:1249:2: '=' + // InternalComputation.g:1516:1: ( '=' ) + // InternalComputation.g:1517:2: '=' { before(grammarAccess.getOperationAccess().getEqualsSignKeyword_3()); match(input,14,FOLLOW_2); @@ -3802,16 +4631,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__4" - // InternalComputation.g:1258:1: rule__Operation__Group__4 : rule__Operation__Group__4__Impl rule__Operation__Group__5 ; + // InternalComputation.g:1526:1: rule__Operation__Group__4 : rule__Operation__Group__4__Impl rule__Operation__Group__5 ; public final void rule__Operation__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1262:1: ( rule__Operation__Group__4__Impl rule__Operation__Group__5 ) - // InternalComputation.g:1263:2: rule__Operation__Group__4__Impl rule__Operation__Group__5 + // InternalComputation.g:1530:1: ( rule__Operation__Group__4__Impl rule__Operation__Group__5 ) + // InternalComputation.g:1531:2: rule__Operation__Group__4__Impl rule__Operation__Group__5 { - pushFollow(FOLLOW_21); + pushFollow(FOLLOW_24); rule__Operation__Group__4__Impl(); state._fsp--; @@ -3840,21 +4669,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__4__Impl" - // InternalComputation.g:1270:1: rule__Operation__Group__4__Impl : ( ( rule__Operation__InputExpr1Assignment_4 ) ) ; + // InternalComputation.g:1538:1: rule__Operation__Group__4__Impl : ( ( rule__Operation__InputExpr1Assignment_4 ) ) ; public final void rule__Operation__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1274:1: ( ( ( rule__Operation__InputExpr1Assignment_4 ) ) ) - // InternalComputation.g:1275:1: ( ( rule__Operation__InputExpr1Assignment_4 ) ) + // InternalComputation.g:1542:1: ( ( ( rule__Operation__InputExpr1Assignment_4 ) ) ) + // InternalComputation.g:1543:1: ( ( rule__Operation__InputExpr1Assignment_4 ) ) { - // InternalComputation.g:1275:1: ( ( rule__Operation__InputExpr1Assignment_4 ) ) - // InternalComputation.g:1276:2: ( rule__Operation__InputExpr1Assignment_4 ) + // InternalComputation.g:1543:1: ( ( rule__Operation__InputExpr1Assignment_4 ) ) + // InternalComputation.g:1544:2: ( rule__Operation__InputExpr1Assignment_4 ) { before(grammarAccess.getOperationAccess().getInputExpr1Assignment_4()); - // InternalComputation.g:1277:2: ( rule__Operation__InputExpr1Assignment_4 ) - // InternalComputation.g:1277:3: rule__Operation__InputExpr1Assignment_4 + // InternalComputation.g:1545:2: ( rule__Operation__InputExpr1Assignment_4 ) + // InternalComputation.g:1545:3: rule__Operation__InputExpr1Assignment_4 { pushFollow(FOLLOW_2); rule__Operation__InputExpr1Assignment_4(); @@ -3887,16 +4716,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__5" - // InternalComputation.g:1285:1: rule__Operation__Group__5 : rule__Operation__Group__5__Impl rule__Operation__Group__6 ; + // InternalComputation.g:1553:1: rule__Operation__Group__5 : rule__Operation__Group__5__Impl rule__Operation__Group__6 ; public final void rule__Operation__Group__5() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1289:1: ( rule__Operation__Group__5__Impl rule__Operation__Group__6 ) - // InternalComputation.g:1290:2: rule__Operation__Group__5__Impl rule__Operation__Group__6 + // InternalComputation.g:1557:1: ( rule__Operation__Group__5__Impl rule__Operation__Group__6 ) + // InternalComputation.g:1558:2: rule__Operation__Group__5__Impl rule__Operation__Group__6 { - pushFollow(FOLLOW_20); + pushFollow(FOLLOW_23); rule__Operation__Group__5__Impl(); state._fsp--; @@ -3925,20 +4754,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__5__Impl" - // InternalComputation.g:1297:1: rule__Operation__Group__5__Impl : ( 'op' ) ; + // InternalComputation.g:1565:1: rule__Operation__Group__5__Impl : ( 'op' ) ; public final void rule__Operation__Group__5__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1301:1: ( ( 'op' ) ) - // InternalComputation.g:1302:1: ( 'op' ) + // InternalComputation.g:1569:1: ( ( 'op' ) ) + // InternalComputation.g:1570:1: ( 'op' ) { - // InternalComputation.g:1302:1: ( 'op' ) - // InternalComputation.g:1303:2: 'op' + // InternalComputation.g:1570:1: ( 'op' ) + // InternalComputation.g:1571:2: 'op' { before(grammarAccess.getOperationAccess().getOpKeyword_5()); - match(input,24,FOLLOW_2); + match(input,26,FOLLOW_2); after(grammarAccess.getOperationAccess().getOpKeyword_5()); } @@ -3962,16 +4791,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__6" - // InternalComputation.g:1312:1: rule__Operation__Group__6 : rule__Operation__Group__6__Impl rule__Operation__Group__7 ; + // InternalComputation.g:1580:1: rule__Operation__Group__6 : rule__Operation__Group__6__Impl rule__Operation__Group__7 ; public final void rule__Operation__Group__6() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1316:1: ( rule__Operation__Group__6__Impl rule__Operation__Group__7 ) - // InternalComputation.g:1317:2: rule__Operation__Group__6__Impl rule__Operation__Group__7 + // InternalComputation.g:1584:1: ( rule__Operation__Group__6__Impl rule__Operation__Group__7 ) + // InternalComputation.g:1585:2: rule__Operation__Group__6__Impl rule__Operation__Group__7 { - pushFollow(FOLLOW_22); + pushFollow(FOLLOW_25); rule__Operation__Group__6__Impl(); state._fsp--; @@ -4000,21 +4829,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__6__Impl" - // InternalComputation.g:1324:1: rule__Operation__Group__6__Impl : ( ( rule__Operation__InputExpr2Assignment_6 ) ) ; + // InternalComputation.g:1592:1: rule__Operation__Group__6__Impl : ( ( rule__Operation__InputExpr2Assignment_6 ) ) ; public final void rule__Operation__Group__6__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1328:1: ( ( ( rule__Operation__InputExpr2Assignment_6 ) ) ) - // InternalComputation.g:1329:1: ( ( rule__Operation__InputExpr2Assignment_6 ) ) + // InternalComputation.g:1596:1: ( ( ( rule__Operation__InputExpr2Assignment_6 ) ) ) + // InternalComputation.g:1597:1: ( ( rule__Operation__InputExpr2Assignment_6 ) ) { - // InternalComputation.g:1329:1: ( ( rule__Operation__InputExpr2Assignment_6 ) ) - // InternalComputation.g:1330:2: ( rule__Operation__InputExpr2Assignment_6 ) + // InternalComputation.g:1597:1: ( ( rule__Operation__InputExpr2Assignment_6 ) ) + // InternalComputation.g:1598:2: ( rule__Operation__InputExpr2Assignment_6 ) { before(grammarAccess.getOperationAccess().getInputExpr2Assignment_6()); - // InternalComputation.g:1331:2: ( rule__Operation__InputExpr2Assignment_6 ) - // InternalComputation.g:1331:3: rule__Operation__InputExpr2Assignment_6 + // InternalComputation.g:1599:2: ( rule__Operation__InputExpr2Assignment_6 ) + // InternalComputation.g:1599:3: rule__Operation__InputExpr2Assignment_6 { pushFollow(FOLLOW_2); rule__Operation__InputExpr2Assignment_6(); @@ -4047,16 +4876,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__7" - // InternalComputation.g:1339:1: rule__Operation__Group__7 : rule__Operation__Group__7__Impl rule__Operation__Group__8 ; + // InternalComputation.g:1607:1: rule__Operation__Group__7 : rule__Operation__Group__7__Impl rule__Operation__Group__8 ; public final void rule__Operation__Group__7() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1343:1: ( rule__Operation__Group__7__Impl rule__Operation__Group__8 ) - // InternalComputation.g:1344:2: rule__Operation__Group__7__Impl rule__Operation__Group__8 + // InternalComputation.g:1611:1: ( rule__Operation__Group__7__Impl rule__Operation__Group__8 ) + // InternalComputation.g:1612:2: rule__Operation__Group__7__Impl rule__Operation__Group__8 { - pushFollow(FOLLOW_15); + pushFollow(FOLLOW_16); rule__Operation__Group__7__Impl(); state._fsp--; @@ -4085,20 +4914,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__7__Impl" - // InternalComputation.g:1351:1: rule__Operation__Group__7__Impl : ( 'x' ) ; + // InternalComputation.g:1619:1: rule__Operation__Group__7__Impl : ( 'x' ) ; public final void rule__Operation__Group__7__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1355:1: ( ( 'x' ) ) - // InternalComputation.g:1356:1: ( 'x' ) + // InternalComputation.g:1623:1: ( ( 'x' ) ) + // InternalComputation.g:1624:1: ( 'x' ) { - // InternalComputation.g:1356:1: ( 'x' ) - // InternalComputation.g:1357:2: 'x' + // InternalComputation.g:1624:1: ( 'x' ) + // InternalComputation.g:1625:2: 'x' { before(grammarAccess.getOperationAccess().getXKeyword_7()); - match(input,25,FOLLOW_2); + match(input,27,FOLLOW_2); after(grammarAccess.getOperationAccess().getXKeyword_7()); } @@ -4122,16 +4951,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__8" - // InternalComputation.g:1366:1: rule__Operation__Group__8 : rule__Operation__Group__8__Impl rule__Operation__Group__9 ; + // InternalComputation.g:1634:1: rule__Operation__Group__8 : rule__Operation__Group__8__Impl rule__Operation__Group__9 ; public final void rule__Operation__Group__8() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1370:1: ( rule__Operation__Group__8__Impl rule__Operation__Group__9 ) - // InternalComputation.g:1371:2: rule__Operation__Group__8__Impl rule__Operation__Group__9 + // InternalComputation.g:1638:1: ( rule__Operation__Group__8__Impl rule__Operation__Group__9 ) + // InternalComputation.g:1639:2: rule__Operation__Group__8__Impl rule__Operation__Group__9 { - pushFollow(FOLLOW_10); + pushFollow(FOLLOW_11); rule__Operation__Group__8__Impl(); state._fsp--; @@ -4160,21 +4989,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__8__Impl" - // InternalComputation.g:1378:1: rule__Operation__Group__8__Impl : ( ( rule__Operation__NumOpsAssignment_8 ) ) ; + // InternalComputation.g:1646:1: rule__Operation__Group__8__Impl : ( ( rule__Operation__NumOpsAssignment_8 ) ) ; public final void rule__Operation__Group__8__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1382:1: ( ( ( rule__Operation__NumOpsAssignment_8 ) ) ) - // InternalComputation.g:1383:1: ( ( rule__Operation__NumOpsAssignment_8 ) ) + // InternalComputation.g:1650:1: ( ( ( rule__Operation__NumOpsAssignment_8 ) ) ) + // InternalComputation.g:1651:1: ( ( rule__Operation__NumOpsAssignment_8 ) ) { - // InternalComputation.g:1383:1: ( ( rule__Operation__NumOpsAssignment_8 ) ) - // InternalComputation.g:1384:2: ( rule__Operation__NumOpsAssignment_8 ) + // InternalComputation.g:1651:1: ( ( rule__Operation__NumOpsAssignment_8 ) ) + // InternalComputation.g:1652:2: ( rule__Operation__NumOpsAssignment_8 ) { before(grammarAccess.getOperationAccess().getNumOpsAssignment_8()); - // InternalComputation.g:1385:2: ( rule__Operation__NumOpsAssignment_8 ) - // InternalComputation.g:1385:3: rule__Operation__NumOpsAssignment_8 + // InternalComputation.g:1653:2: ( rule__Operation__NumOpsAssignment_8 ) + // InternalComputation.g:1653:3: rule__Operation__NumOpsAssignment_8 { pushFollow(FOLLOW_2); rule__Operation__NumOpsAssignment_8(); @@ -4207,14 +5036,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__9" - // InternalComputation.g:1393:1: rule__Operation__Group__9 : rule__Operation__Group__9__Impl ; + // InternalComputation.g:1661:1: rule__Operation__Group__9 : rule__Operation__Group__9__Impl ; public final void rule__Operation__Group__9() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1397:1: ( rule__Operation__Group__9__Impl ) - // InternalComputation.g:1398:2: rule__Operation__Group__9__Impl + // InternalComputation.g:1665:1: ( rule__Operation__Group__9__Impl ) + // InternalComputation.g:1666:2: rule__Operation__Group__9__Impl { pushFollow(FOLLOW_2); rule__Operation__Group__9__Impl(); @@ -4240,17 +5069,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__Group__9__Impl" - // InternalComputation.g:1404:1: rule__Operation__Group__9__Impl : ( ';' ) ; + // InternalComputation.g:1672:1: rule__Operation__Group__9__Impl : ( ';' ) ; public final void rule__Operation__Group__9__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1408:1: ( ( ';' ) ) - // InternalComputation.g:1409:1: ( ';' ) + // InternalComputation.g:1676:1: ( ( ';' ) ) + // InternalComputation.g:1677:1: ( ';' ) { - // InternalComputation.g:1409:1: ( ';' ) - // InternalComputation.g:1410:2: ';' + // InternalComputation.g:1677:1: ( ';' ) + // InternalComputation.g:1678:2: ';' { before(grammarAccess.getOperationAccess().getSemicolonKeyword_9()); match(input,15,FOLLOW_2); @@ -4277,16 +5106,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__Group__0" - // InternalComputation.g:1420:1: rule__MaxExpression__Group__0 : rule__MaxExpression__Group__0__Impl rule__MaxExpression__Group__1 ; + // InternalComputation.g:1688:1: rule__MaxExpression__Group__0 : rule__MaxExpression__Group__0__Impl rule__MaxExpression__Group__1 ; public final void rule__MaxExpression__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1424:1: ( rule__MaxExpression__Group__0__Impl rule__MaxExpression__Group__1 ) - // InternalComputation.g:1425:2: rule__MaxExpression__Group__0__Impl rule__MaxExpression__Group__1 + // InternalComputation.g:1692:1: ( rule__MaxExpression__Group__0__Impl rule__MaxExpression__Group__1 ) + // InternalComputation.g:1693:2: rule__MaxExpression__Group__0__Impl rule__MaxExpression__Group__1 { - pushFollow(FOLLOW_23); + pushFollow(FOLLOW_26); rule__MaxExpression__Group__0__Impl(); state._fsp--; @@ -4315,20 +5144,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__Group__0__Impl" - // InternalComputation.g:1432:1: rule__MaxExpression__Group__0__Impl : ( 'max' ) ; + // InternalComputation.g:1700:1: rule__MaxExpression__Group__0__Impl : ( 'max' ) ; public final void rule__MaxExpression__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1436:1: ( ( 'max' ) ) - // InternalComputation.g:1437:1: ( 'max' ) + // InternalComputation.g:1704:1: ( ( 'max' ) ) + // InternalComputation.g:1705:1: ( 'max' ) { - // InternalComputation.g:1437:1: ( 'max' ) - // InternalComputation.g:1438:2: 'max' + // InternalComputation.g:1705:1: ( 'max' ) + // InternalComputation.g:1706:2: 'max' { before(grammarAccess.getMaxExpressionAccess().getMaxKeyword_0()); - match(input,26,FOLLOW_2); + match(input,28,FOLLOW_2); after(grammarAccess.getMaxExpressionAccess().getMaxKeyword_0()); } @@ -4352,16 +5181,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__Group__1" - // InternalComputation.g:1447:1: rule__MaxExpression__Group__1 : rule__MaxExpression__Group__1__Impl rule__MaxExpression__Group__2 ; + // InternalComputation.g:1715:1: rule__MaxExpression__Group__1 : rule__MaxExpression__Group__1__Impl rule__MaxExpression__Group__2 ; public final void rule__MaxExpression__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1451:1: ( rule__MaxExpression__Group__1__Impl rule__MaxExpression__Group__2 ) - // InternalComputation.g:1452:2: rule__MaxExpression__Group__1__Impl rule__MaxExpression__Group__2 + // InternalComputation.g:1719:1: ( rule__MaxExpression__Group__1__Impl rule__MaxExpression__Group__2 ) + // InternalComputation.g:1720:2: rule__MaxExpression__Group__1__Impl rule__MaxExpression__Group__2 { - pushFollow(FOLLOW_20); + pushFollow(FOLLOW_23); rule__MaxExpression__Group__1__Impl(); state._fsp--; @@ -4390,20 +5219,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__Group__1__Impl" - // InternalComputation.g:1459:1: rule__MaxExpression__Group__1__Impl : ( '(' ) ; + // InternalComputation.g:1727:1: rule__MaxExpression__Group__1__Impl : ( '(' ) ; public final void rule__MaxExpression__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1463:1: ( ( '(' ) ) - // InternalComputation.g:1464:1: ( '(' ) + // InternalComputation.g:1731:1: ( ( '(' ) ) + // InternalComputation.g:1732:1: ( '(' ) { - // InternalComputation.g:1464:1: ( '(' ) - // InternalComputation.g:1465:2: '(' + // InternalComputation.g:1732:1: ( '(' ) + // InternalComputation.g:1733:2: '(' { before(grammarAccess.getMaxExpressionAccess().getLeftParenthesisKeyword_1()); - match(input,27,FOLLOW_2); + match(input,29,FOLLOW_2); after(grammarAccess.getMaxExpressionAccess().getLeftParenthesisKeyword_1()); } @@ -4427,16 +5256,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__Group__2" - // InternalComputation.g:1474:1: rule__MaxExpression__Group__2 : rule__MaxExpression__Group__2__Impl rule__MaxExpression__Group__3 ; + // InternalComputation.g:1742:1: rule__MaxExpression__Group__2 : rule__MaxExpression__Group__2__Impl rule__MaxExpression__Group__3 ; public final void rule__MaxExpression__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1478:1: ( rule__MaxExpression__Group__2__Impl rule__MaxExpression__Group__3 ) - // InternalComputation.g:1479:2: rule__MaxExpression__Group__2__Impl rule__MaxExpression__Group__3 + // InternalComputation.g:1746:1: ( rule__MaxExpression__Group__2__Impl rule__MaxExpression__Group__3 ) + // InternalComputation.g:1747:2: rule__MaxExpression__Group__2__Impl rule__MaxExpression__Group__3 { - pushFollow(FOLLOW_24); + pushFollow(FOLLOW_27); rule__MaxExpression__Group__2__Impl(); state._fsp--; @@ -4465,21 +5294,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__Group__2__Impl" - // InternalComputation.g:1486:1: rule__MaxExpression__Group__2__Impl : ( ( rule__MaxExpression__ExprsAssignment_2 ) ) ; + // InternalComputation.g:1754:1: rule__MaxExpression__Group__2__Impl : ( ( rule__MaxExpression__ExprsAssignment_2 ) ) ; public final void rule__MaxExpression__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1490:1: ( ( ( rule__MaxExpression__ExprsAssignment_2 ) ) ) - // InternalComputation.g:1491:1: ( ( rule__MaxExpression__ExprsAssignment_2 ) ) + // InternalComputation.g:1758:1: ( ( ( rule__MaxExpression__ExprsAssignment_2 ) ) ) + // InternalComputation.g:1759:1: ( ( rule__MaxExpression__ExprsAssignment_2 ) ) { - // InternalComputation.g:1491:1: ( ( rule__MaxExpression__ExprsAssignment_2 ) ) - // InternalComputation.g:1492:2: ( rule__MaxExpression__ExprsAssignment_2 ) + // InternalComputation.g:1759:1: ( ( rule__MaxExpression__ExprsAssignment_2 ) ) + // InternalComputation.g:1760:2: ( rule__MaxExpression__ExprsAssignment_2 ) { before(grammarAccess.getMaxExpressionAccess().getExprsAssignment_2()); - // InternalComputation.g:1493:2: ( rule__MaxExpression__ExprsAssignment_2 ) - // InternalComputation.g:1493:3: rule__MaxExpression__ExprsAssignment_2 + // InternalComputation.g:1761:2: ( rule__MaxExpression__ExprsAssignment_2 ) + // InternalComputation.g:1761:3: rule__MaxExpression__ExprsAssignment_2 { pushFollow(FOLLOW_2); rule__MaxExpression__ExprsAssignment_2(); @@ -4512,16 +5341,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__Group__3" - // InternalComputation.g:1501:1: rule__MaxExpression__Group__3 : rule__MaxExpression__Group__3__Impl rule__MaxExpression__Group__4 ; + // InternalComputation.g:1769:1: rule__MaxExpression__Group__3 : rule__MaxExpression__Group__3__Impl rule__MaxExpression__Group__4 ; public final void rule__MaxExpression__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1505:1: ( rule__MaxExpression__Group__3__Impl rule__MaxExpression__Group__4 ) - // InternalComputation.g:1506:2: rule__MaxExpression__Group__3__Impl rule__MaxExpression__Group__4 + // InternalComputation.g:1773:1: ( rule__MaxExpression__Group__3__Impl rule__MaxExpression__Group__4 ) + // InternalComputation.g:1774:2: rule__MaxExpression__Group__3__Impl rule__MaxExpression__Group__4 { - pushFollow(FOLLOW_25); + pushFollow(FOLLOW_28); rule__MaxExpression__Group__3__Impl(); state._fsp--; @@ -4550,26 +5379,26 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__Group__3__Impl" - // InternalComputation.g:1513:1: rule__MaxExpression__Group__3__Impl : ( ( ( rule__MaxExpression__Group_3__0 ) ) ( ( rule__MaxExpression__Group_3__0 )* ) ) ; + // InternalComputation.g:1781:1: rule__MaxExpression__Group__3__Impl : ( ( ( rule__MaxExpression__Group_3__0 ) ) ( ( rule__MaxExpression__Group_3__0 )* ) ) ; public final void rule__MaxExpression__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1517:1: ( ( ( ( rule__MaxExpression__Group_3__0 ) ) ( ( rule__MaxExpression__Group_3__0 )* ) ) ) - // InternalComputation.g:1518:1: ( ( ( rule__MaxExpression__Group_3__0 ) ) ( ( rule__MaxExpression__Group_3__0 )* ) ) + // InternalComputation.g:1785:1: ( ( ( ( rule__MaxExpression__Group_3__0 ) ) ( ( rule__MaxExpression__Group_3__0 )* ) ) ) + // InternalComputation.g:1786:1: ( ( ( rule__MaxExpression__Group_3__0 ) ) ( ( rule__MaxExpression__Group_3__0 )* ) ) { - // InternalComputation.g:1518:1: ( ( ( rule__MaxExpression__Group_3__0 ) ) ( ( rule__MaxExpression__Group_3__0 )* ) ) - // InternalComputation.g:1519:2: ( ( rule__MaxExpression__Group_3__0 ) ) ( ( rule__MaxExpression__Group_3__0 )* ) + // InternalComputation.g:1786:1: ( ( ( rule__MaxExpression__Group_3__0 ) ) ( ( rule__MaxExpression__Group_3__0 )* ) ) + // InternalComputation.g:1787:2: ( ( rule__MaxExpression__Group_3__0 ) ) ( ( rule__MaxExpression__Group_3__0 )* ) { - // InternalComputation.g:1519:2: ( ( rule__MaxExpression__Group_3__0 ) ) - // InternalComputation.g:1520:3: ( rule__MaxExpression__Group_3__0 ) + // InternalComputation.g:1787:2: ( ( rule__MaxExpression__Group_3__0 ) ) + // InternalComputation.g:1788:3: ( rule__MaxExpression__Group_3__0 ) { before(grammarAccess.getMaxExpressionAccess().getGroup_3()); - // InternalComputation.g:1521:3: ( rule__MaxExpression__Group_3__0 ) - // InternalComputation.g:1521:4: rule__MaxExpression__Group_3__0 + // InternalComputation.g:1789:3: ( rule__MaxExpression__Group_3__0 ) + // InternalComputation.g:1789:4: rule__MaxExpression__Group_3__0 { - pushFollow(FOLLOW_26); + pushFollow(FOLLOW_19); rule__MaxExpression__Group_3__0(); state._fsp--; @@ -4581,26 +5410,26 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } - // InternalComputation.g:1524:2: ( ( rule__MaxExpression__Group_3__0 )* ) - // InternalComputation.g:1525:3: ( rule__MaxExpression__Group_3__0 )* + // InternalComputation.g:1792:2: ( ( rule__MaxExpression__Group_3__0 )* ) + // InternalComputation.g:1793:3: ( rule__MaxExpression__Group_3__0 )* { before(grammarAccess.getMaxExpressionAccess().getGroup_3()); - // InternalComputation.g:1526:3: ( rule__MaxExpression__Group_3__0 )* - loop8: + // InternalComputation.g:1794:3: ( rule__MaxExpression__Group_3__0 )* + loop10: do { - int alt8=2; - int LA8_0 = input.LA(1); + int alt10=2; + int LA10_0 = input.LA(1); - if ( (LA8_0==29) ) { - alt8=1; + if ( (LA10_0==23) ) { + alt10=1; } - switch (alt8) { + switch (alt10) { case 1 : - // InternalComputation.g:1526:4: rule__MaxExpression__Group_3__0 + // InternalComputation.g:1794:4: rule__MaxExpression__Group_3__0 { - pushFollow(FOLLOW_26); + pushFollow(FOLLOW_19); rule__MaxExpression__Group_3__0(); state._fsp--; @@ -4610,7 +5439,7 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars break; default : - break loop8; + break loop10; } } while (true); @@ -4640,14 +5469,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__Group__4" - // InternalComputation.g:1535:1: rule__MaxExpression__Group__4 : rule__MaxExpression__Group__4__Impl ; + // InternalComputation.g:1803:1: rule__MaxExpression__Group__4 : rule__MaxExpression__Group__4__Impl ; public final void rule__MaxExpression__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1539:1: ( rule__MaxExpression__Group__4__Impl ) - // InternalComputation.g:1540:2: rule__MaxExpression__Group__4__Impl + // InternalComputation.g:1807:1: ( rule__MaxExpression__Group__4__Impl ) + // InternalComputation.g:1808:2: rule__MaxExpression__Group__4__Impl { pushFollow(FOLLOW_2); rule__MaxExpression__Group__4__Impl(); @@ -4673,20 +5502,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__Group__4__Impl" - // InternalComputation.g:1546:1: rule__MaxExpression__Group__4__Impl : ( ')' ) ; + // InternalComputation.g:1814:1: rule__MaxExpression__Group__4__Impl : ( ')' ) ; public final void rule__MaxExpression__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1550:1: ( ( ')' ) ) - // InternalComputation.g:1551:1: ( ')' ) + // InternalComputation.g:1818:1: ( ( ')' ) ) + // InternalComputation.g:1819:1: ( ')' ) { - // InternalComputation.g:1551:1: ( ')' ) - // InternalComputation.g:1552:2: ')' + // InternalComputation.g:1819:1: ( ')' ) + // InternalComputation.g:1820:2: ')' { before(grammarAccess.getMaxExpressionAccess().getRightParenthesisKeyword_4()); - match(input,28,FOLLOW_2); + match(input,30,FOLLOW_2); after(grammarAccess.getMaxExpressionAccess().getRightParenthesisKeyword_4()); } @@ -4710,16 +5539,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__Group_3__0" - // InternalComputation.g:1562:1: rule__MaxExpression__Group_3__0 : rule__MaxExpression__Group_3__0__Impl rule__MaxExpression__Group_3__1 ; + // InternalComputation.g:1830:1: rule__MaxExpression__Group_3__0 : rule__MaxExpression__Group_3__0__Impl rule__MaxExpression__Group_3__1 ; public final void rule__MaxExpression__Group_3__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1566:1: ( rule__MaxExpression__Group_3__0__Impl rule__MaxExpression__Group_3__1 ) - // InternalComputation.g:1567:2: rule__MaxExpression__Group_3__0__Impl rule__MaxExpression__Group_3__1 + // InternalComputation.g:1834:1: ( rule__MaxExpression__Group_3__0__Impl rule__MaxExpression__Group_3__1 ) + // InternalComputation.g:1835:2: rule__MaxExpression__Group_3__0__Impl rule__MaxExpression__Group_3__1 { - pushFollow(FOLLOW_20); + pushFollow(FOLLOW_23); rule__MaxExpression__Group_3__0__Impl(); state._fsp--; @@ -4748,20 +5577,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__Group_3__0__Impl" - // InternalComputation.g:1574:1: rule__MaxExpression__Group_3__0__Impl : ( ',' ) ; + // InternalComputation.g:1842:1: rule__MaxExpression__Group_3__0__Impl : ( ',' ) ; public final void rule__MaxExpression__Group_3__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1578:1: ( ( ',' ) ) - // InternalComputation.g:1579:1: ( ',' ) + // InternalComputation.g:1846:1: ( ( ',' ) ) + // InternalComputation.g:1847:1: ( ',' ) { - // InternalComputation.g:1579:1: ( ',' ) - // InternalComputation.g:1580:2: ',' + // InternalComputation.g:1847:1: ( ',' ) + // InternalComputation.g:1848:2: ',' { before(grammarAccess.getMaxExpressionAccess().getCommaKeyword_3_0()); - match(input,29,FOLLOW_2); + match(input,23,FOLLOW_2); after(grammarAccess.getMaxExpressionAccess().getCommaKeyword_3_0()); } @@ -4785,14 +5614,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__Group_3__1" - // InternalComputation.g:1589:1: rule__MaxExpression__Group_3__1 : rule__MaxExpression__Group_3__1__Impl ; + // InternalComputation.g:1857:1: rule__MaxExpression__Group_3__1 : rule__MaxExpression__Group_3__1__Impl ; public final void rule__MaxExpression__Group_3__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1593:1: ( rule__MaxExpression__Group_3__1__Impl ) - // InternalComputation.g:1594:2: rule__MaxExpression__Group_3__1__Impl + // InternalComputation.g:1861:1: ( rule__MaxExpression__Group_3__1__Impl ) + // InternalComputation.g:1862:2: rule__MaxExpression__Group_3__1__Impl { pushFollow(FOLLOW_2); rule__MaxExpression__Group_3__1__Impl(); @@ -4818,21 +5647,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__Group_3__1__Impl" - // InternalComputation.g:1600:1: rule__MaxExpression__Group_3__1__Impl : ( ( rule__MaxExpression__ExprsAssignment_3_1 ) ) ; + // InternalComputation.g:1868:1: rule__MaxExpression__Group_3__1__Impl : ( ( rule__MaxExpression__ExprsAssignment_3_1 ) ) ; public final void rule__MaxExpression__Group_3__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1604:1: ( ( ( rule__MaxExpression__ExprsAssignment_3_1 ) ) ) - // InternalComputation.g:1605:1: ( ( rule__MaxExpression__ExprsAssignment_3_1 ) ) + // InternalComputation.g:1872:1: ( ( ( rule__MaxExpression__ExprsAssignment_3_1 ) ) ) + // InternalComputation.g:1873:1: ( ( rule__MaxExpression__ExprsAssignment_3_1 ) ) { - // InternalComputation.g:1605:1: ( ( rule__MaxExpression__ExprsAssignment_3_1 ) ) - // InternalComputation.g:1606:2: ( rule__MaxExpression__ExprsAssignment_3_1 ) + // InternalComputation.g:1873:1: ( ( rule__MaxExpression__ExprsAssignment_3_1 ) ) + // InternalComputation.g:1874:2: ( rule__MaxExpression__ExprsAssignment_3_1 ) { before(grammarAccess.getMaxExpressionAccess().getExprsAssignment_3_1()); - // InternalComputation.g:1607:2: ( rule__MaxExpression__ExprsAssignment_3_1 ) - // InternalComputation.g:1607:3: rule__MaxExpression__ExprsAssignment_3_1 + // InternalComputation.g:1875:2: ( rule__MaxExpression__ExprsAssignment_3_1 ) + // InternalComputation.g:1875:3: rule__MaxExpression__ExprsAssignment_3_1 { pushFollow(FOLLOW_2); rule__MaxExpression__ExprsAssignment_3_1(); @@ -4865,16 +5694,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__AddExpression__Group__0" - // InternalComputation.g:1616:1: rule__AddExpression__Group__0 : rule__AddExpression__Group__0__Impl rule__AddExpression__Group__1 ; + // InternalComputation.g:1884:1: rule__AddExpression__Group__0 : rule__AddExpression__Group__0__Impl rule__AddExpression__Group__1 ; public final void rule__AddExpression__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1620:1: ( rule__AddExpression__Group__0__Impl rule__AddExpression__Group__1 ) - // InternalComputation.g:1621:2: rule__AddExpression__Group__0__Impl rule__AddExpression__Group__1 + // InternalComputation.g:1888:1: ( rule__AddExpression__Group__0__Impl rule__AddExpression__Group__1 ) + // InternalComputation.g:1889:2: rule__AddExpression__Group__0__Impl rule__AddExpression__Group__1 { - pushFollow(FOLLOW_20); + pushFollow(FOLLOW_23); rule__AddExpression__Group__0__Impl(); state._fsp--; @@ -4903,20 +5732,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__AddExpression__Group__0__Impl" - // InternalComputation.g:1628:1: rule__AddExpression__Group__0__Impl : ( '(' ) ; + // InternalComputation.g:1896:1: rule__AddExpression__Group__0__Impl : ( '(' ) ; public final void rule__AddExpression__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1632:1: ( ( '(' ) ) - // InternalComputation.g:1633:1: ( '(' ) + // InternalComputation.g:1900:1: ( ( '(' ) ) + // InternalComputation.g:1901:1: ( '(' ) { - // InternalComputation.g:1633:1: ( '(' ) - // InternalComputation.g:1634:2: '(' + // InternalComputation.g:1901:1: ( '(' ) + // InternalComputation.g:1902:2: '(' { before(grammarAccess.getAddExpressionAccess().getLeftParenthesisKeyword_0()); - match(input,27,FOLLOW_2); + match(input,29,FOLLOW_2); after(grammarAccess.getAddExpressionAccess().getLeftParenthesisKeyword_0()); } @@ -4940,16 +5769,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__AddExpression__Group__1" - // InternalComputation.g:1643:1: rule__AddExpression__Group__1 : rule__AddExpression__Group__1__Impl rule__AddExpression__Group__2 ; + // InternalComputation.g:1911:1: rule__AddExpression__Group__1 : rule__AddExpression__Group__1__Impl rule__AddExpression__Group__2 ; public final void rule__AddExpression__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1647:1: ( rule__AddExpression__Group__1__Impl rule__AddExpression__Group__2 ) - // InternalComputation.g:1648:2: rule__AddExpression__Group__1__Impl rule__AddExpression__Group__2 + // InternalComputation.g:1915:1: ( rule__AddExpression__Group__1__Impl rule__AddExpression__Group__2 ) + // InternalComputation.g:1916:2: rule__AddExpression__Group__1__Impl rule__AddExpression__Group__2 { - pushFollow(FOLLOW_27); + pushFollow(FOLLOW_29); rule__AddExpression__Group__1__Impl(); state._fsp--; @@ -4978,21 +5807,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__AddExpression__Group__1__Impl" - // InternalComputation.g:1655:1: rule__AddExpression__Group__1__Impl : ( ( rule__AddExpression__Op1Assignment_1 ) ) ; + // InternalComputation.g:1923:1: rule__AddExpression__Group__1__Impl : ( ( rule__AddExpression__Op1Assignment_1 ) ) ; public final void rule__AddExpression__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1659:1: ( ( ( rule__AddExpression__Op1Assignment_1 ) ) ) - // InternalComputation.g:1660:1: ( ( rule__AddExpression__Op1Assignment_1 ) ) + // InternalComputation.g:1927:1: ( ( ( rule__AddExpression__Op1Assignment_1 ) ) ) + // InternalComputation.g:1928:1: ( ( rule__AddExpression__Op1Assignment_1 ) ) { - // InternalComputation.g:1660:1: ( ( rule__AddExpression__Op1Assignment_1 ) ) - // InternalComputation.g:1661:2: ( rule__AddExpression__Op1Assignment_1 ) + // InternalComputation.g:1928:1: ( ( rule__AddExpression__Op1Assignment_1 ) ) + // InternalComputation.g:1929:2: ( rule__AddExpression__Op1Assignment_1 ) { before(grammarAccess.getAddExpressionAccess().getOp1Assignment_1()); - // InternalComputation.g:1662:2: ( rule__AddExpression__Op1Assignment_1 ) - // InternalComputation.g:1662:3: rule__AddExpression__Op1Assignment_1 + // InternalComputation.g:1930:2: ( rule__AddExpression__Op1Assignment_1 ) + // InternalComputation.g:1930:3: rule__AddExpression__Op1Assignment_1 { pushFollow(FOLLOW_2); rule__AddExpression__Op1Assignment_1(); @@ -5025,16 +5854,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__AddExpression__Group__2" - // InternalComputation.g:1670:1: rule__AddExpression__Group__2 : rule__AddExpression__Group__2__Impl rule__AddExpression__Group__3 ; + // InternalComputation.g:1938:1: rule__AddExpression__Group__2 : rule__AddExpression__Group__2__Impl rule__AddExpression__Group__3 ; public final void rule__AddExpression__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1674:1: ( rule__AddExpression__Group__2__Impl rule__AddExpression__Group__3 ) - // InternalComputation.g:1675:2: rule__AddExpression__Group__2__Impl rule__AddExpression__Group__3 + // InternalComputation.g:1942:1: ( rule__AddExpression__Group__2__Impl rule__AddExpression__Group__3 ) + // InternalComputation.g:1943:2: rule__AddExpression__Group__2__Impl rule__AddExpression__Group__3 { - pushFollow(FOLLOW_20); + pushFollow(FOLLOW_23); rule__AddExpression__Group__2__Impl(); state._fsp--; @@ -5063,20 +5892,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__AddExpression__Group__2__Impl" - // InternalComputation.g:1682:1: rule__AddExpression__Group__2__Impl : ( '+' ) ; + // InternalComputation.g:1950:1: rule__AddExpression__Group__2__Impl : ( '+' ) ; public final void rule__AddExpression__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1686:1: ( ( '+' ) ) - // InternalComputation.g:1687:1: ( '+' ) + // InternalComputation.g:1954:1: ( ( '+' ) ) + // InternalComputation.g:1955:1: ( '+' ) { - // InternalComputation.g:1687:1: ( '+' ) - // InternalComputation.g:1688:2: '+' + // InternalComputation.g:1955:1: ( '+' ) + // InternalComputation.g:1956:2: '+' { before(grammarAccess.getAddExpressionAccess().getPlusSignKeyword_2()); - match(input,30,FOLLOW_2); + match(input,31,FOLLOW_2); after(grammarAccess.getAddExpressionAccess().getPlusSignKeyword_2()); } @@ -5100,16 +5929,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__AddExpression__Group__3" - // InternalComputation.g:1697:1: rule__AddExpression__Group__3 : rule__AddExpression__Group__3__Impl rule__AddExpression__Group__4 ; + // InternalComputation.g:1965:1: rule__AddExpression__Group__3 : rule__AddExpression__Group__3__Impl rule__AddExpression__Group__4 ; public final void rule__AddExpression__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1701:1: ( rule__AddExpression__Group__3__Impl rule__AddExpression__Group__4 ) - // InternalComputation.g:1702:2: rule__AddExpression__Group__3__Impl rule__AddExpression__Group__4 + // InternalComputation.g:1969:1: ( rule__AddExpression__Group__3__Impl rule__AddExpression__Group__4 ) + // InternalComputation.g:1970:2: rule__AddExpression__Group__3__Impl rule__AddExpression__Group__4 { - pushFollow(FOLLOW_25); + pushFollow(FOLLOW_28); rule__AddExpression__Group__3__Impl(); state._fsp--; @@ -5138,21 +5967,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__AddExpression__Group__3__Impl" - // InternalComputation.g:1709:1: rule__AddExpression__Group__3__Impl : ( ( rule__AddExpression__Op2Assignment_3 ) ) ; + // InternalComputation.g:1977:1: rule__AddExpression__Group__3__Impl : ( ( rule__AddExpression__Op2Assignment_3 ) ) ; public final void rule__AddExpression__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1713:1: ( ( ( rule__AddExpression__Op2Assignment_3 ) ) ) - // InternalComputation.g:1714:1: ( ( rule__AddExpression__Op2Assignment_3 ) ) + // InternalComputation.g:1981:1: ( ( ( rule__AddExpression__Op2Assignment_3 ) ) ) + // InternalComputation.g:1982:1: ( ( rule__AddExpression__Op2Assignment_3 ) ) { - // InternalComputation.g:1714:1: ( ( rule__AddExpression__Op2Assignment_3 ) ) - // InternalComputation.g:1715:2: ( rule__AddExpression__Op2Assignment_3 ) + // InternalComputation.g:1982:1: ( ( rule__AddExpression__Op2Assignment_3 ) ) + // InternalComputation.g:1983:2: ( rule__AddExpression__Op2Assignment_3 ) { before(grammarAccess.getAddExpressionAccess().getOp2Assignment_3()); - // InternalComputation.g:1716:2: ( rule__AddExpression__Op2Assignment_3 ) - // InternalComputation.g:1716:3: rule__AddExpression__Op2Assignment_3 + // InternalComputation.g:1984:2: ( rule__AddExpression__Op2Assignment_3 ) + // InternalComputation.g:1984:3: rule__AddExpression__Op2Assignment_3 { pushFollow(FOLLOW_2); rule__AddExpression__Op2Assignment_3(); @@ -5185,14 +6014,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__AddExpression__Group__4" - // InternalComputation.g:1724:1: rule__AddExpression__Group__4 : rule__AddExpression__Group__4__Impl ; + // InternalComputation.g:1992:1: rule__AddExpression__Group__4 : rule__AddExpression__Group__4__Impl ; public final void rule__AddExpression__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1728:1: ( rule__AddExpression__Group__4__Impl ) - // InternalComputation.g:1729:2: rule__AddExpression__Group__4__Impl + // InternalComputation.g:1996:1: ( rule__AddExpression__Group__4__Impl ) + // InternalComputation.g:1997:2: rule__AddExpression__Group__4__Impl { pushFollow(FOLLOW_2); rule__AddExpression__Group__4__Impl(); @@ -5218,20 +6047,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__AddExpression__Group__4__Impl" - // InternalComputation.g:1735:1: rule__AddExpression__Group__4__Impl : ( ')' ) ; + // InternalComputation.g:2003:1: rule__AddExpression__Group__4__Impl : ( ')' ) ; public final void rule__AddExpression__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1739:1: ( ( ')' ) ) - // InternalComputation.g:1740:1: ( ')' ) + // InternalComputation.g:2007:1: ( ( ')' ) ) + // InternalComputation.g:2008:1: ( ')' ) { - // InternalComputation.g:1740:1: ( ')' ) - // InternalComputation.g:1741:2: ')' + // InternalComputation.g:2008:1: ( ')' ) + // InternalComputation.g:2009:2: ')' { before(grammarAccess.getAddExpressionAccess().getRightParenthesisKeyword_4()); - match(input,28,FOLLOW_2); + match(input,30,FOLLOW_2); after(grammarAccess.getAddExpressionAccess().getRightParenthesisKeyword_4()); } @@ -5255,16 +6084,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__OperandTerm__Group__0" - // InternalComputation.g:1751:1: rule__OperandTerm__Group__0 : rule__OperandTerm__Group__0__Impl rule__OperandTerm__Group__1 ; + // InternalComputation.g:2019:1: rule__OperandTerm__Group__0 : rule__OperandTerm__Group__0__Impl rule__OperandTerm__Group__1 ; public final void rule__OperandTerm__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1755:1: ( rule__OperandTerm__Group__0__Impl rule__OperandTerm__Group__1 ) - // InternalComputation.g:1756:2: rule__OperandTerm__Group__0__Impl rule__OperandTerm__Group__1 + // InternalComputation.g:2023:1: ( rule__OperandTerm__Group__0__Impl rule__OperandTerm__Group__1 ) + // InternalComputation.g:2024:2: rule__OperandTerm__Group__0__Impl rule__OperandTerm__Group__1 { - pushFollow(FOLLOW_20); + pushFollow(FOLLOW_23); rule__OperandTerm__Group__0__Impl(); state._fsp--; @@ -5293,29 +6122,29 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__OperandTerm__Group__0__Impl" - // InternalComputation.g:1763:1: rule__OperandTerm__Group__0__Impl : ( ( rule__OperandTerm__CoefAssignment_0 )? ) ; + // InternalComputation.g:2031:1: rule__OperandTerm__Group__0__Impl : ( ( rule__OperandTerm__CoefAssignment_0 )? ) ; public final void rule__OperandTerm__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1767:1: ( ( ( rule__OperandTerm__CoefAssignment_0 )? ) ) - // InternalComputation.g:1768:1: ( ( rule__OperandTerm__CoefAssignment_0 )? ) + // InternalComputation.g:2035:1: ( ( ( rule__OperandTerm__CoefAssignment_0 )? ) ) + // InternalComputation.g:2036:1: ( ( rule__OperandTerm__CoefAssignment_0 )? ) { - // InternalComputation.g:1768:1: ( ( rule__OperandTerm__CoefAssignment_0 )? ) - // InternalComputation.g:1769:2: ( rule__OperandTerm__CoefAssignment_0 )? + // InternalComputation.g:2036:1: ( ( rule__OperandTerm__CoefAssignment_0 )? ) + // InternalComputation.g:2037:2: ( rule__OperandTerm__CoefAssignment_0 )? { before(grammarAccess.getOperandTermAccess().getCoefAssignment_0()); - // InternalComputation.g:1770:2: ( rule__OperandTerm__CoefAssignment_0 )? - int alt9=2; - int LA9_0 = input.LA(1); + // InternalComputation.g:2038:2: ( rule__OperandTerm__CoefAssignment_0 )? + int alt11=2; + int LA11_0 = input.LA(1); - if ( (LA9_0==RULE_INT) ) { - alt9=1; + if ( (LA11_0==RULE_INT) ) { + alt11=1; } - switch (alt9) { + switch (alt11) { case 1 : - // InternalComputation.g:1770:3: rule__OperandTerm__CoefAssignment_0 + // InternalComputation.g:2038:3: rule__OperandTerm__CoefAssignment_0 { pushFollow(FOLLOW_2); rule__OperandTerm__CoefAssignment_0(); @@ -5351,14 +6180,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__OperandTerm__Group__1" - // InternalComputation.g:1778:1: rule__OperandTerm__Group__1 : rule__OperandTerm__Group__1__Impl ; + // InternalComputation.g:2046:1: rule__OperandTerm__Group__1 : rule__OperandTerm__Group__1__Impl ; public final void rule__OperandTerm__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1782:1: ( rule__OperandTerm__Group__1__Impl ) - // InternalComputation.g:1783:2: rule__OperandTerm__Group__1__Impl + // InternalComputation.g:2050:1: ( rule__OperandTerm__Group__1__Impl ) + // InternalComputation.g:2051:2: rule__OperandTerm__Group__1__Impl { pushFollow(FOLLOW_2); rule__OperandTerm__Group__1__Impl(); @@ -5384,21 +6213,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__OperandTerm__Group__1__Impl" - // InternalComputation.g:1789:1: rule__OperandTerm__Group__1__Impl : ( ( rule__OperandTerm__NameAssignment_1 ) ) ; + // InternalComputation.g:2057:1: rule__OperandTerm__Group__1__Impl : ( ( rule__OperandTerm__NameAssignment_1 ) ) ; public final void rule__OperandTerm__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1793:1: ( ( ( rule__OperandTerm__NameAssignment_1 ) ) ) - // InternalComputation.g:1794:1: ( ( rule__OperandTerm__NameAssignment_1 ) ) + // InternalComputation.g:2061:1: ( ( ( rule__OperandTerm__NameAssignment_1 ) ) ) + // InternalComputation.g:2062:1: ( ( rule__OperandTerm__NameAssignment_1 ) ) { - // InternalComputation.g:1794:1: ( ( rule__OperandTerm__NameAssignment_1 ) ) - // InternalComputation.g:1795:2: ( rule__OperandTerm__NameAssignment_1 ) + // InternalComputation.g:2062:1: ( ( rule__OperandTerm__NameAssignment_1 ) ) + // InternalComputation.g:2063:2: ( rule__OperandTerm__NameAssignment_1 ) { before(grammarAccess.getOperandTermAccess().getNameAssignment_1()); - // InternalComputation.g:1796:2: ( rule__OperandTerm__NameAssignment_1 ) - // InternalComputation.g:1796:3: rule__OperandTerm__NameAssignment_1 + // InternalComputation.g:2064:2: ( rule__OperandTerm__NameAssignment_1 ) + // InternalComputation.g:2064:3: rule__OperandTerm__NameAssignment_1 { pushFollow(FOLLOW_2); rule__OperandTerm__NameAssignment_1(); @@ -5431,16 +6260,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0__0" - // InternalComputation.g:1805:1: rule__SummationExpression__Group_0__0 : rule__SummationExpression__Group_0__0__Impl rule__SummationExpression__Group_0__1 ; + // InternalComputation.g:2073:1: rule__SummationExpression__Group_0__0 : rule__SummationExpression__Group_0__0__Impl rule__SummationExpression__Group_0__1 ; public final void rule__SummationExpression__Group_0__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1809:1: ( rule__SummationExpression__Group_0__0__Impl rule__SummationExpression__Group_0__1 ) - // InternalComputation.g:1810:2: rule__SummationExpression__Group_0__0__Impl rule__SummationExpression__Group_0__1 + // InternalComputation.g:2077:1: ( rule__SummationExpression__Group_0__0__Impl rule__SummationExpression__Group_0__1 ) + // InternalComputation.g:2078:2: rule__SummationExpression__Group_0__0__Impl rule__SummationExpression__Group_0__1 { - pushFollow(FOLLOW_27); + pushFollow(FOLLOW_29); rule__SummationExpression__Group_0__0__Impl(); state._fsp--; @@ -5469,21 +6298,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0__0__Impl" - // InternalComputation.g:1817:1: rule__SummationExpression__Group_0__0__Impl : ( ( rule__SummationExpression__Group_0_0__0 ) ) ; + // InternalComputation.g:2085:1: rule__SummationExpression__Group_0__0__Impl : ( ( rule__SummationExpression__Group_0_0__0 ) ) ; public final void rule__SummationExpression__Group_0__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1821:1: ( ( ( rule__SummationExpression__Group_0_0__0 ) ) ) - // InternalComputation.g:1822:1: ( ( rule__SummationExpression__Group_0_0__0 ) ) + // InternalComputation.g:2089:1: ( ( ( rule__SummationExpression__Group_0_0__0 ) ) ) + // InternalComputation.g:2090:1: ( ( rule__SummationExpression__Group_0_0__0 ) ) { - // InternalComputation.g:1822:1: ( ( rule__SummationExpression__Group_0_0__0 ) ) - // InternalComputation.g:1823:2: ( rule__SummationExpression__Group_0_0__0 ) + // InternalComputation.g:2090:1: ( ( rule__SummationExpression__Group_0_0__0 ) ) + // InternalComputation.g:2091:2: ( rule__SummationExpression__Group_0_0__0 ) { before(grammarAccess.getSummationExpressionAccess().getGroup_0_0()); - // InternalComputation.g:1824:2: ( rule__SummationExpression__Group_0_0__0 ) - // InternalComputation.g:1824:3: rule__SummationExpression__Group_0_0__0 + // InternalComputation.g:2092:2: ( rule__SummationExpression__Group_0_0__0 ) + // InternalComputation.g:2092:3: rule__SummationExpression__Group_0_0__0 { pushFollow(FOLLOW_2); rule__SummationExpression__Group_0_0__0(); @@ -5516,14 +6345,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0__1" - // InternalComputation.g:1832:1: rule__SummationExpression__Group_0__1 : rule__SummationExpression__Group_0__1__Impl ; + // InternalComputation.g:2100:1: rule__SummationExpression__Group_0__1 : rule__SummationExpression__Group_0__1__Impl ; public final void rule__SummationExpression__Group_0__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1836:1: ( rule__SummationExpression__Group_0__1__Impl ) - // InternalComputation.g:1837:2: rule__SummationExpression__Group_0__1__Impl + // InternalComputation.g:2104:1: ( rule__SummationExpression__Group_0__1__Impl ) + // InternalComputation.g:2105:2: rule__SummationExpression__Group_0__1__Impl { pushFollow(FOLLOW_2); rule__SummationExpression__Group_0__1__Impl(); @@ -5549,29 +6378,29 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0__1__Impl" - // InternalComputation.g:1843:1: rule__SummationExpression__Group_0__1__Impl : ( ( rule__SummationExpression__Group_0_1__0 )? ) ; + // InternalComputation.g:2111:1: rule__SummationExpression__Group_0__1__Impl : ( ( rule__SummationExpression__Group_0_1__0 )? ) ; public final void rule__SummationExpression__Group_0__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1847:1: ( ( ( rule__SummationExpression__Group_0_1__0 )? ) ) - // InternalComputation.g:1848:1: ( ( rule__SummationExpression__Group_0_1__0 )? ) + // InternalComputation.g:2115:1: ( ( ( rule__SummationExpression__Group_0_1__0 )? ) ) + // InternalComputation.g:2116:1: ( ( rule__SummationExpression__Group_0_1__0 )? ) { - // InternalComputation.g:1848:1: ( ( rule__SummationExpression__Group_0_1__0 )? ) - // InternalComputation.g:1849:2: ( rule__SummationExpression__Group_0_1__0 )? + // InternalComputation.g:2116:1: ( ( rule__SummationExpression__Group_0_1__0 )? ) + // InternalComputation.g:2117:2: ( rule__SummationExpression__Group_0_1__0 )? { before(grammarAccess.getSummationExpressionAccess().getGroup_0_1()); - // InternalComputation.g:1850:2: ( rule__SummationExpression__Group_0_1__0 )? - int alt10=2; - int LA10_0 = input.LA(1); + // InternalComputation.g:2118:2: ( rule__SummationExpression__Group_0_1__0 )? + int alt12=2; + int LA12_0 = input.LA(1); - if ( (LA10_0==30) ) { - alt10=1; + if ( (LA12_0==31) ) { + alt12=1; } - switch (alt10) { + switch (alt12) { case 1 : - // InternalComputation.g:1850:3: rule__SummationExpression__Group_0_1__0 + // InternalComputation.g:2118:3: rule__SummationExpression__Group_0_1__0 { pushFollow(FOLLOW_2); rule__SummationExpression__Group_0_1__0(); @@ -5607,16 +6436,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0_0__0" - // InternalComputation.g:1859:1: rule__SummationExpression__Group_0_0__0 : rule__SummationExpression__Group_0_0__0__Impl rule__SummationExpression__Group_0_0__1 ; + // InternalComputation.g:2127:1: rule__SummationExpression__Group_0_0__0 : rule__SummationExpression__Group_0_0__0__Impl rule__SummationExpression__Group_0_0__1 ; public final void rule__SummationExpression__Group_0_0__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1863:1: ( rule__SummationExpression__Group_0_0__0__Impl rule__SummationExpression__Group_0_0__1 ) - // InternalComputation.g:1864:2: rule__SummationExpression__Group_0_0__0__Impl rule__SummationExpression__Group_0_0__1 + // InternalComputation.g:2131:1: ( rule__SummationExpression__Group_0_0__0__Impl rule__SummationExpression__Group_0_0__1 ) + // InternalComputation.g:2132:2: rule__SummationExpression__Group_0_0__0__Impl rule__SummationExpression__Group_0_0__1 { - pushFollow(FOLLOW_27); + pushFollow(FOLLOW_29); rule__SummationExpression__Group_0_0__0__Impl(); state._fsp--; @@ -5645,21 +6474,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0_0__0__Impl" - // InternalComputation.g:1871:1: rule__SummationExpression__Group_0_0__0__Impl : ( ( rule__SummationExpression__TermsAssignment_0_0_0 ) ) ; + // InternalComputation.g:2139:1: rule__SummationExpression__Group_0_0__0__Impl : ( ( rule__SummationExpression__TermsAssignment_0_0_0 ) ) ; public final void rule__SummationExpression__Group_0_0__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1875:1: ( ( ( rule__SummationExpression__TermsAssignment_0_0_0 ) ) ) - // InternalComputation.g:1876:1: ( ( rule__SummationExpression__TermsAssignment_0_0_0 ) ) + // InternalComputation.g:2143:1: ( ( ( rule__SummationExpression__TermsAssignment_0_0_0 ) ) ) + // InternalComputation.g:2144:1: ( ( rule__SummationExpression__TermsAssignment_0_0_0 ) ) { - // InternalComputation.g:1876:1: ( ( rule__SummationExpression__TermsAssignment_0_0_0 ) ) - // InternalComputation.g:1877:2: ( rule__SummationExpression__TermsAssignment_0_0_0 ) + // InternalComputation.g:2144:1: ( ( rule__SummationExpression__TermsAssignment_0_0_0 ) ) + // InternalComputation.g:2145:2: ( rule__SummationExpression__TermsAssignment_0_0_0 ) { before(grammarAccess.getSummationExpressionAccess().getTermsAssignment_0_0_0()); - // InternalComputation.g:1878:2: ( rule__SummationExpression__TermsAssignment_0_0_0 ) - // InternalComputation.g:1878:3: rule__SummationExpression__TermsAssignment_0_0_0 + // InternalComputation.g:2146:2: ( rule__SummationExpression__TermsAssignment_0_0_0 ) + // InternalComputation.g:2146:3: rule__SummationExpression__TermsAssignment_0_0_0 { pushFollow(FOLLOW_2); rule__SummationExpression__TermsAssignment_0_0_0(); @@ -5692,14 +6521,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0_0__1" - // InternalComputation.g:1886:1: rule__SummationExpression__Group_0_0__1 : rule__SummationExpression__Group_0_0__1__Impl ; + // InternalComputation.g:2154:1: rule__SummationExpression__Group_0_0__1 : rule__SummationExpression__Group_0_0__1__Impl ; public final void rule__SummationExpression__Group_0_0__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1890:1: ( rule__SummationExpression__Group_0_0__1__Impl ) - // InternalComputation.g:1891:2: rule__SummationExpression__Group_0_0__1__Impl + // InternalComputation.g:2158:1: ( rule__SummationExpression__Group_0_0__1__Impl ) + // InternalComputation.g:2159:2: rule__SummationExpression__Group_0_0__1__Impl { pushFollow(FOLLOW_2); rule__SummationExpression__Group_0_0__1__Impl(); @@ -5725,50 +6554,50 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0_0__1__Impl" - // InternalComputation.g:1897:1: rule__SummationExpression__Group_0_0__1__Impl : ( ( rule__SummationExpression__Group_0_0_1__0 )* ) ; + // InternalComputation.g:2165:1: rule__SummationExpression__Group_0_0__1__Impl : ( ( rule__SummationExpression__Group_0_0_1__0 )* ) ; public final void rule__SummationExpression__Group_0_0__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1901:1: ( ( ( rule__SummationExpression__Group_0_0_1__0 )* ) ) - // InternalComputation.g:1902:1: ( ( rule__SummationExpression__Group_0_0_1__0 )* ) + // InternalComputation.g:2169:1: ( ( ( rule__SummationExpression__Group_0_0_1__0 )* ) ) + // InternalComputation.g:2170:1: ( ( rule__SummationExpression__Group_0_0_1__0 )* ) { - // InternalComputation.g:1902:1: ( ( rule__SummationExpression__Group_0_0_1__0 )* ) - // InternalComputation.g:1903:2: ( rule__SummationExpression__Group_0_0_1__0 )* + // InternalComputation.g:2170:1: ( ( rule__SummationExpression__Group_0_0_1__0 )* ) + // InternalComputation.g:2171:2: ( rule__SummationExpression__Group_0_0_1__0 )* { before(grammarAccess.getSummationExpressionAccess().getGroup_0_0_1()); - // InternalComputation.g:1904:2: ( rule__SummationExpression__Group_0_0_1__0 )* - loop11: + // InternalComputation.g:2172:2: ( rule__SummationExpression__Group_0_0_1__0 )* + loop13: do { - int alt11=2; - int LA11_0 = input.LA(1); + int alt13=2; + int LA13_0 = input.LA(1); - if ( (LA11_0==30) ) { - int LA11_1 = input.LA(2); + if ( (LA13_0==31) ) { + int LA13_1 = input.LA(2); - if ( (LA11_1==RULE_INT) ) { - int LA11_3 = input.LA(3); + if ( (LA13_1==RULE_INT) ) { + int LA13_3 = input.LA(3); - if ( (LA11_3==RULE_ID) ) { - alt11=1; + if ( (LA13_3==RULE_ID) ) { + alt13=1; } } - else if ( (LA11_1==RULE_ID) ) { - alt11=1; + else if ( (LA13_1==RULE_ID) ) { + alt13=1; } } - switch (alt11) { + switch (alt13) { case 1 : - // InternalComputation.g:1904:3: rule__SummationExpression__Group_0_0_1__0 + // InternalComputation.g:2172:3: rule__SummationExpression__Group_0_0_1__0 { - pushFollow(FOLLOW_28); + pushFollow(FOLLOW_30); rule__SummationExpression__Group_0_0_1__0(); state._fsp--; @@ -5778,7 +6607,7 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars break; default : - break loop11; + break loop13; } } while (true); @@ -5805,16 +6634,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0_0_1__0" - // InternalComputation.g:1913:1: rule__SummationExpression__Group_0_0_1__0 : rule__SummationExpression__Group_0_0_1__0__Impl rule__SummationExpression__Group_0_0_1__1 ; + // InternalComputation.g:2181:1: rule__SummationExpression__Group_0_0_1__0 : rule__SummationExpression__Group_0_0_1__0__Impl rule__SummationExpression__Group_0_0_1__1 ; public final void rule__SummationExpression__Group_0_0_1__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1917:1: ( rule__SummationExpression__Group_0_0_1__0__Impl rule__SummationExpression__Group_0_0_1__1 ) - // InternalComputation.g:1918:2: rule__SummationExpression__Group_0_0_1__0__Impl rule__SummationExpression__Group_0_0_1__1 + // InternalComputation.g:2185:1: ( rule__SummationExpression__Group_0_0_1__0__Impl rule__SummationExpression__Group_0_0_1__1 ) + // InternalComputation.g:2186:2: rule__SummationExpression__Group_0_0_1__0__Impl rule__SummationExpression__Group_0_0_1__1 { - pushFollow(FOLLOW_15); + pushFollow(FOLLOW_16); rule__SummationExpression__Group_0_0_1__0__Impl(); state._fsp--; @@ -5843,20 +6672,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0_0_1__0__Impl" - // InternalComputation.g:1925:1: rule__SummationExpression__Group_0_0_1__0__Impl : ( '+' ) ; + // InternalComputation.g:2193:1: rule__SummationExpression__Group_0_0_1__0__Impl : ( '+' ) ; public final void rule__SummationExpression__Group_0_0_1__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1929:1: ( ( '+' ) ) - // InternalComputation.g:1930:1: ( '+' ) + // InternalComputation.g:2197:1: ( ( '+' ) ) + // InternalComputation.g:2198:1: ( '+' ) { - // InternalComputation.g:1930:1: ( '+' ) - // InternalComputation.g:1931:2: '+' + // InternalComputation.g:2198:1: ( '+' ) + // InternalComputation.g:2199:2: '+' { before(grammarAccess.getSummationExpressionAccess().getPlusSignKeyword_0_0_1_0()); - match(input,30,FOLLOW_2); + match(input,31,FOLLOW_2); after(grammarAccess.getSummationExpressionAccess().getPlusSignKeyword_0_0_1_0()); } @@ -5880,14 +6709,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0_0_1__1" - // InternalComputation.g:1940:1: rule__SummationExpression__Group_0_0_1__1 : rule__SummationExpression__Group_0_0_1__1__Impl ; + // InternalComputation.g:2208:1: rule__SummationExpression__Group_0_0_1__1 : rule__SummationExpression__Group_0_0_1__1__Impl ; public final void rule__SummationExpression__Group_0_0_1__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1944:1: ( rule__SummationExpression__Group_0_0_1__1__Impl ) - // InternalComputation.g:1945:2: rule__SummationExpression__Group_0_0_1__1__Impl + // InternalComputation.g:2212:1: ( rule__SummationExpression__Group_0_0_1__1__Impl ) + // InternalComputation.g:2213:2: rule__SummationExpression__Group_0_0_1__1__Impl { pushFollow(FOLLOW_2); rule__SummationExpression__Group_0_0_1__1__Impl(); @@ -5913,21 +6742,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0_0_1__1__Impl" - // InternalComputation.g:1951:1: rule__SummationExpression__Group_0_0_1__1__Impl : ( ( rule__SummationExpression__TermsAssignment_0_0_1_1 ) ) ; + // InternalComputation.g:2219:1: rule__SummationExpression__Group_0_0_1__1__Impl : ( ( rule__SummationExpression__TermsAssignment_0_0_1_1 ) ) ; public final void rule__SummationExpression__Group_0_0_1__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1955:1: ( ( ( rule__SummationExpression__TermsAssignment_0_0_1_1 ) ) ) - // InternalComputation.g:1956:1: ( ( rule__SummationExpression__TermsAssignment_0_0_1_1 ) ) + // InternalComputation.g:2223:1: ( ( ( rule__SummationExpression__TermsAssignment_0_0_1_1 ) ) ) + // InternalComputation.g:2224:1: ( ( rule__SummationExpression__TermsAssignment_0_0_1_1 ) ) { - // InternalComputation.g:1956:1: ( ( rule__SummationExpression__TermsAssignment_0_0_1_1 ) ) - // InternalComputation.g:1957:2: ( rule__SummationExpression__TermsAssignment_0_0_1_1 ) + // InternalComputation.g:2224:1: ( ( rule__SummationExpression__TermsAssignment_0_0_1_1 ) ) + // InternalComputation.g:2225:2: ( rule__SummationExpression__TermsAssignment_0_0_1_1 ) { before(grammarAccess.getSummationExpressionAccess().getTermsAssignment_0_0_1_1()); - // InternalComputation.g:1958:2: ( rule__SummationExpression__TermsAssignment_0_0_1_1 ) - // InternalComputation.g:1958:3: rule__SummationExpression__TermsAssignment_0_0_1_1 + // InternalComputation.g:2226:2: ( rule__SummationExpression__TermsAssignment_0_0_1_1 ) + // InternalComputation.g:2226:3: rule__SummationExpression__TermsAssignment_0_0_1_1 { pushFollow(FOLLOW_2); rule__SummationExpression__TermsAssignment_0_0_1_1(); @@ -5960,16 +6789,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0_1__0" - // InternalComputation.g:1967:1: rule__SummationExpression__Group_0_1__0 : rule__SummationExpression__Group_0_1__0__Impl rule__SummationExpression__Group_0_1__1 ; + // InternalComputation.g:2235:1: rule__SummationExpression__Group_0_1__0 : rule__SummationExpression__Group_0_1__0__Impl rule__SummationExpression__Group_0_1__1 ; public final void rule__SummationExpression__Group_0_1__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1971:1: ( rule__SummationExpression__Group_0_1__0__Impl rule__SummationExpression__Group_0_1__1 ) - // InternalComputation.g:1972:2: rule__SummationExpression__Group_0_1__0__Impl rule__SummationExpression__Group_0_1__1 + // InternalComputation.g:2239:1: ( rule__SummationExpression__Group_0_1__0__Impl rule__SummationExpression__Group_0_1__1 ) + // InternalComputation.g:2240:2: rule__SummationExpression__Group_0_1__0__Impl rule__SummationExpression__Group_0_1__1 { - pushFollow(FOLLOW_9); + pushFollow(FOLLOW_10); rule__SummationExpression__Group_0_1__0__Impl(); state._fsp--; @@ -5998,20 +6827,20 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0_1__0__Impl" - // InternalComputation.g:1979:1: rule__SummationExpression__Group_0_1__0__Impl : ( '+' ) ; + // InternalComputation.g:2247:1: rule__SummationExpression__Group_0_1__0__Impl : ( '+' ) ; public final void rule__SummationExpression__Group_0_1__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1983:1: ( ( '+' ) ) - // InternalComputation.g:1984:1: ( '+' ) + // InternalComputation.g:2251:1: ( ( '+' ) ) + // InternalComputation.g:2252:1: ( '+' ) { - // InternalComputation.g:1984:1: ( '+' ) - // InternalComputation.g:1985:2: '+' + // InternalComputation.g:2252:1: ( '+' ) + // InternalComputation.g:2253:2: '+' { before(grammarAccess.getSummationExpressionAccess().getPlusSignKeyword_0_1_0()); - match(input,30,FOLLOW_2); + match(input,31,FOLLOW_2); after(grammarAccess.getSummationExpressionAccess().getPlusSignKeyword_0_1_0()); } @@ -6035,14 +6864,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0_1__1" - // InternalComputation.g:1994:1: rule__SummationExpression__Group_0_1__1 : rule__SummationExpression__Group_0_1__1__Impl ; + // InternalComputation.g:2262:1: rule__SummationExpression__Group_0_1__1 : rule__SummationExpression__Group_0_1__1__Impl ; public final void rule__SummationExpression__Group_0_1__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:1998:1: ( rule__SummationExpression__Group_0_1__1__Impl ) - // InternalComputation.g:1999:2: rule__SummationExpression__Group_0_1__1__Impl + // InternalComputation.g:2266:1: ( rule__SummationExpression__Group_0_1__1__Impl ) + // InternalComputation.g:2267:2: rule__SummationExpression__Group_0_1__1__Impl { pushFollow(FOLLOW_2); rule__SummationExpression__Group_0_1__1__Impl(); @@ -6068,21 +6897,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__Group_0_1__1__Impl" - // InternalComputation.g:2005:1: rule__SummationExpression__Group_0_1__1__Impl : ( ( rule__SummationExpression__ConstantAssignment_0_1_1 ) ) ; + // InternalComputation.g:2273:1: rule__SummationExpression__Group_0_1__1__Impl : ( ( rule__SummationExpression__ConstantAssignment_0_1_1 ) ) ; public final void rule__SummationExpression__Group_0_1__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2009:1: ( ( ( rule__SummationExpression__ConstantAssignment_0_1_1 ) ) ) - // InternalComputation.g:2010:1: ( ( rule__SummationExpression__ConstantAssignment_0_1_1 ) ) + // InternalComputation.g:2277:1: ( ( ( rule__SummationExpression__ConstantAssignment_0_1_1 ) ) ) + // InternalComputation.g:2278:1: ( ( rule__SummationExpression__ConstantAssignment_0_1_1 ) ) { - // InternalComputation.g:2010:1: ( ( rule__SummationExpression__ConstantAssignment_0_1_1 ) ) - // InternalComputation.g:2011:2: ( rule__SummationExpression__ConstantAssignment_0_1_1 ) + // InternalComputation.g:2278:1: ( ( rule__SummationExpression__ConstantAssignment_0_1_1 ) ) + // InternalComputation.g:2279:2: ( rule__SummationExpression__ConstantAssignment_0_1_1 ) { before(grammarAccess.getSummationExpressionAccess().getConstantAssignment_0_1_1()); - // InternalComputation.g:2012:2: ( rule__SummationExpression__ConstantAssignment_0_1_1 ) - // InternalComputation.g:2012:3: rule__SummationExpression__ConstantAssignment_0_1_1 + // InternalComputation.g:2280:2: ( rule__SummationExpression__ConstantAssignment_0_1_1 ) + // InternalComputation.g:2280:3: rule__SummationExpression__ConstantAssignment_0_1_1 { pushFollow(FOLLOW_2); rule__SummationExpression__ConstantAssignment_0_1_1(); @@ -6115,16 +6944,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ProductExpression__Group__0" - // InternalComputation.g:2021:1: rule__ProductExpression__Group__0 : rule__ProductExpression__Group__0__Impl rule__ProductExpression__Group__1 ; + // InternalComputation.g:2289:1: rule__ProductExpression__Group__0 : rule__ProductExpression__Group__0__Impl rule__ProductExpression__Group__1 ; public final void rule__ProductExpression__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2025:1: ( rule__ProductExpression__Group__0__Impl rule__ProductExpression__Group__1 ) - // InternalComputation.g:2026:2: rule__ProductExpression__Group__0__Impl rule__ProductExpression__Group__1 + // InternalComputation.g:2293:1: ( rule__ProductExpression__Group__0__Impl rule__ProductExpression__Group__1 ) + // InternalComputation.g:2294:2: rule__ProductExpression__Group__0__Impl rule__ProductExpression__Group__1 { - pushFollow(FOLLOW_15); + pushFollow(FOLLOW_16); rule__ProductExpression__Group__0__Impl(); state._fsp--; @@ -6153,29 +6982,29 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ProductExpression__Group__0__Impl" - // InternalComputation.g:2033:1: rule__ProductExpression__Group__0__Impl : ( ( rule__ProductExpression__ConstantAssignment_0 )? ) ; + // InternalComputation.g:2301:1: rule__ProductExpression__Group__0__Impl : ( ( rule__ProductExpression__ConstantAssignment_0 )? ) ; public final void rule__ProductExpression__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2037:1: ( ( ( rule__ProductExpression__ConstantAssignment_0 )? ) ) - // InternalComputation.g:2038:1: ( ( rule__ProductExpression__ConstantAssignment_0 )? ) + // InternalComputation.g:2305:1: ( ( ( rule__ProductExpression__ConstantAssignment_0 )? ) ) + // InternalComputation.g:2306:1: ( ( rule__ProductExpression__ConstantAssignment_0 )? ) { - // InternalComputation.g:2038:1: ( ( rule__ProductExpression__ConstantAssignment_0 )? ) - // InternalComputation.g:2039:2: ( rule__ProductExpression__ConstantAssignment_0 )? + // InternalComputation.g:2306:1: ( ( rule__ProductExpression__ConstantAssignment_0 )? ) + // InternalComputation.g:2307:2: ( rule__ProductExpression__ConstantAssignment_0 )? { before(grammarAccess.getProductExpressionAccess().getConstantAssignment_0()); - // InternalComputation.g:2040:2: ( rule__ProductExpression__ConstantAssignment_0 )? - int alt12=2; - int LA12_0 = input.LA(1); + // InternalComputation.g:2308:2: ( rule__ProductExpression__ConstantAssignment_0 )? + int alt14=2; + int LA14_0 = input.LA(1); - if ( (LA12_0==RULE_INT) ) { - alt12=1; + if ( (LA14_0==RULE_INT) ) { + alt14=1; } - switch (alt12) { + switch (alt14) { case 1 : - // InternalComputation.g:2040:3: rule__ProductExpression__ConstantAssignment_0 + // InternalComputation.g:2308:3: rule__ProductExpression__ConstantAssignment_0 { pushFollow(FOLLOW_2); rule__ProductExpression__ConstantAssignment_0(); @@ -6211,14 +7040,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ProductExpression__Group__1" - // InternalComputation.g:2048:1: rule__ProductExpression__Group__1 : rule__ProductExpression__Group__1__Impl ; + // InternalComputation.g:2316:1: rule__ProductExpression__Group__1 : rule__ProductExpression__Group__1__Impl ; public final void rule__ProductExpression__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2052:1: ( rule__ProductExpression__Group__1__Impl ) - // InternalComputation.g:2053:2: rule__ProductExpression__Group__1__Impl + // InternalComputation.g:2320:1: ( rule__ProductExpression__Group__1__Impl ) + // InternalComputation.g:2321:2: rule__ProductExpression__Group__1__Impl { pushFollow(FOLLOW_2); rule__ProductExpression__Group__1__Impl(); @@ -6244,21 +7073,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ProductExpression__Group__1__Impl" - // InternalComputation.g:2059:1: rule__ProductExpression__Group__1__Impl : ( ( rule__ProductExpression__Group_1__0 ) ) ; + // InternalComputation.g:2327:1: rule__ProductExpression__Group__1__Impl : ( ( rule__ProductExpression__Group_1__0 ) ) ; public final void rule__ProductExpression__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2063:1: ( ( ( rule__ProductExpression__Group_1__0 ) ) ) - // InternalComputation.g:2064:1: ( ( rule__ProductExpression__Group_1__0 ) ) + // InternalComputation.g:2331:1: ( ( ( rule__ProductExpression__Group_1__0 ) ) ) + // InternalComputation.g:2332:1: ( ( rule__ProductExpression__Group_1__0 ) ) { - // InternalComputation.g:2064:1: ( ( rule__ProductExpression__Group_1__0 ) ) - // InternalComputation.g:2065:2: ( rule__ProductExpression__Group_1__0 ) + // InternalComputation.g:2332:1: ( ( rule__ProductExpression__Group_1__0 ) ) + // InternalComputation.g:2333:2: ( rule__ProductExpression__Group_1__0 ) { before(grammarAccess.getProductExpressionAccess().getGroup_1()); - // InternalComputation.g:2066:2: ( rule__ProductExpression__Group_1__0 ) - // InternalComputation.g:2066:3: rule__ProductExpression__Group_1__0 + // InternalComputation.g:2334:2: ( rule__ProductExpression__Group_1__0 ) + // InternalComputation.g:2334:3: rule__ProductExpression__Group_1__0 { pushFollow(FOLLOW_2); rule__ProductExpression__Group_1__0(); @@ -6291,16 +7120,16 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ProductExpression__Group_1__0" - // InternalComputation.g:2075:1: rule__ProductExpression__Group_1__0 : rule__ProductExpression__Group_1__0__Impl rule__ProductExpression__Group_1__1 ; + // InternalComputation.g:2343:1: rule__ProductExpression__Group_1__0 : rule__ProductExpression__Group_1__0__Impl rule__ProductExpression__Group_1__1 ; public final void rule__ProductExpression__Group_1__0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2079:1: ( rule__ProductExpression__Group_1__0__Impl rule__ProductExpression__Group_1__1 ) - // InternalComputation.g:2080:2: rule__ProductExpression__Group_1__0__Impl rule__ProductExpression__Group_1__1 + // InternalComputation.g:2347:1: ( rule__ProductExpression__Group_1__0__Impl rule__ProductExpression__Group_1__1 ) + // InternalComputation.g:2348:2: rule__ProductExpression__Group_1__0__Impl rule__ProductExpression__Group_1__1 { - pushFollow(FOLLOW_7); + pushFollow(FOLLOW_8); rule__ProductExpression__Group_1__0__Impl(); state._fsp--; @@ -6329,21 +7158,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ProductExpression__Group_1__0__Impl" - // InternalComputation.g:2087:1: rule__ProductExpression__Group_1__0__Impl : ( ( rule__ProductExpression__TermsAssignment_1_0 ) ) ; + // InternalComputation.g:2355:1: rule__ProductExpression__Group_1__0__Impl : ( ( rule__ProductExpression__TermsAssignment_1_0 ) ) ; public final void rule__ProductExpression__Group_1__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2091:1: ( ( ( rule__ProductExpression__TermsAssignment_1_0 ) ) ) - // InternalComputation.g:2092:1: ( ( rule__ProductExpression__TermsAssignment_1_0 ) ) + // InternalComputation.g:2359:1: ( ( ( rule__ProductExpression__TermsAssignment_1_0 ) ) ) + // InternalComputation.g:2360:1: ( ( rule__ProductExpression__TermsAssignment_1_0 ) ) { - // InternalComputation.g:2092:1: ( ( rule__ProductExpression__TermsAssignment_1_0 ) ) - // InternalComputation.g:2093:2: ( rule__ProductExpression__TermsAssignment_1_0 ) + // InternalComputation.g:2360:1: ( ( rule__ProductExpression__TermsAssignment_1_0 ) ) + // InternalComputation.g:2361:2: ( rule__ProductExpression__TermsAssignment_1_0 ) { before(grammarAccess.getProductExpressionAccess().getTermsAssignment_1_0()); - // InternalComputation.g:2094:2: ( rule__ProductExpression__TermsAssignment_1_0 ) - // InternalComputation.g:2094:3: rule__ProductExpression__TermsAssignment_1_0 + // InternalComputation.g:2362:2: ( rule__ProductExpression__TermsAssignment_1_0 ) + // InternalComputation.g:2362:3: rule__ProductExpression__TermsAssignment_1_0 { pushFollow(FOLLOW_2); rule__ProductExpression__TermsAssignment_1_0(); @@ -6376,14 +7205,14 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ProductExpression__Group_1__1" - // InternalComputation.g:2102:1: rule__ProductExpression__Group_1__1 : rule__ProductExpression__Group_1__1__Impl ; + // InternalComputation.g:2370:1: rule__ProductExpression__Group_1__1 : rule__ProductExpression__Group_1__1__Impl ; public final void rule__ProductExpression__Group_1__1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2106:1: ( rule__ProductExpression__Group_1__1__Impl ) - // InternalComputation.g:2107:2: rule__ProductExpression__Group_1__1__Impl + // InternalComputation.g:2374:1: ( rule__ProductExpression__Group_1__1__Impl ) + // InternalComputation.g:2375:2: rule__ProductExpression__Group_1__1__Impl { pushFollow(FOLLOW_2); rule__ProductExpression__Group_1__1__Impl(); @@ -6409,35 +7238,35 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ProductExpression__Group_1__1__Impl" - // InternalComputation.g:2113:1: rule__ProductExpression__Group_1__1__Impl : ( ( rule__ProductExpression__TermsAssignment_1_1 )* ) ; + // InternalComputation.g:2381:1: rule__ProductExpression__Group_1__1__Impl : ( ( rule__ProductExpression__TermsAssignment_1_1 )* ) ; public final void rule__ProductExpression__Group_1__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2117:1: ( ( ( rule__ProductExpression__TermsAssignment_1_1 )* ) ) - // InternalComputation.g:2118:1: ( ( rule__ProductExpression__TermsAssignment_1_1 )* ) + // InternalComputation.g:2385:1: ( ( ( rule__ProductExpression__TermsAssignment_1_1 )* ) ) + // InternalComputation.g:2386:1: ( ( rule__ProductExpression__TermsAssignment_1_1 )* ) { - // InternalComputation.g:2118:1: ( ( rule__ProductExpression__TermsAssignment_1_1 )* ) - // InternalComputation.g:2119:2: ( rule__ProductExpression__TermsAssignment_1_1 )* + // InternalComputation.g:2386:1: ( ( rule__ProductExpression__TermsAssignment_1_1 )* ) + // InternalComputation.g:2387:2: ( rule__ProductExpression__TermsAssignment_1_1 )* { before(grammarAccess.getProductExpressionAccess().getTermsAssignment_1_1()); - // InternalComputation.g:2120:2: ( rule__ProductExpression__TermsAssignment_1_1 )* - loop13: + // InternalComputation.g:2388:2: ( rule__ProductExpression__TermsAssignment_1_1 )* + loop15: do { - int alt13=2; - int LA13_0 = input.LA(1); + int alt15=2; + int LA15_0 = input.LA(1); - if ( (LA13_0==RULE_ID) ) { - alt13=1; + if ( (LA15_0==RULE_ID) ) { + alt15=1; } - switch (alt13) { + switch (alt15) { case 1 : - // InternalComputation.g:2120:3: rule__ProductExpression__TermsAssignment_1_1 + // InternalComputation.g:2388:3: rule__ProductExpression__TermsAssignment_1_1 { - pushFollow(FOLLOW_29); + pushFollow(FOLLOW_31); rule__ProductExpression__TermsAssignment_1_1(); state._fsp--; @@ -6447,7 +7276,7 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars break; default : - break loop13; + break loop15; } } while (true); @@ -6474,17 +7303,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationModel__ParametersAssignment_0" - // InternalComputation.g:2129:1: rule__ComputationModel__ParametersAssignment_0 : ( ruleParameter ) ; + // InternalComputation.g:2397:1: rule__ComputationModel__ParametersAssignment_0 : ( ruleParameter ) ; public final void rule__ComputationModel__ParametersAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2133:1: ( ( ruleParameter ) ) - // InternalComputation.g:2134:2: ( ruleParameter ) + // InternalComputation.g:2401:1: ( ( ruleParameter ) ) + // InternalComputation.g:2402:2: ( ruleParameter ) { - // InternalComputation.g:2134:2: ( ruleParameter ) - // InternalComputation.g:2135:3: ruleParameter + // InternalComputation.g:2402:2: ( ruleParameter ) + // InternalComputation.g:2403:3: ruleParameter { before(grammarAccess.getComputationModelAccess().getParametersParameterParserRuleCall_0_0()); pushFollow(FOLLOW_2); @@ -6515,17 +7344,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationModel__TargetDesignAssignment_1" - // InternalComputation.g:2144:1: rule__ComputationModel__TargetDesignAssignment_1 : ( ruleHWTargetDesign ) ; + // InternalComputation.g:2412:1: rule__ComputationModel__TargetDesignAssignment_1 : ( ruleHWTargetDesign ) ; public final void rule__ComputationModel__TargetDesignAssignment_1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2148:1: ( ( ruleHWTargetDesign ) ) - // InternalComputation.g:2149:2: ( ruleHWTargetDesign ) + // InternalComputation.g:2416:1: ( ( ruleHWTargetDesign ) ) + // InternalComputation.g:2417:2: ( ruleHWTargetDesign ) { - // InternalComputation.g:2149:2: ( ruleHWTargetDesign ) - // InternalComputation.g:2150:3: ruleHWTargetDesign + // InternalComputation.g:2417:2: ( ruleHWTargetDesign ) + // InternalComputation.g:2418:3: ruleHWTargetDesign { before(grammarAccess.getComputationModelAccess().getTargetDesignHWTargetDesignParserRuleCall_1_0()); pushFollow(FOLLOW_2); @@ -6555,26 +7384,67 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR end "rule__ComputationModel__TargetDesignAssignment_1" - // $ANTLR start "rule__ComputationModel__BlocksAssignment_2" - // InternalComputation.g:2159:1: rule__ComputationModel__BlocksAssignment_2 : ( ruleComputationBlock ) ; - public final void rule__ComputationModel__BlocksAssignment_2() throws RecognitionException { + // $ANTLR start "rule__ComputationModel__BlockGroupsAssignment_2" + // InternalComputation.g:2427:1: rule__ComputationModel__BlockGroupsAssignment_2 : ( ruleBlockGroup ) ; + public final void rule__ComputationModel__BlockGroupsAssignment_2() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:2431:1: ( ( ruleBlockGroup ) ) + // InternalComputation.g:2432:2: ( ruleBlockGroup ) + { + // InternalComputation.g:2432:2: ( ruleBlockGroup ) + // InternalComputation.g:2433:3: ruleBlockGroup + { + before(grammarAccess.getComputationModelAccess().getBlockGroupsBlockGroupParserRuleCall_2_0()); + pushFollow(FOLLOW_2); + ruleBlockGroup(); + + state._fsp--; + + after(grammarAccess.getComputationModelAccess().getBlockGroupsBlockGroupParserRuleCall_2_0()); + + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__ComputationModel__BlockGroupsAssignment_2" + + + // $ANTLR start "rule__ComputationModel__BlocksAssignment_3" + // InternalComputation.g:2442:1: rule__ComputationModel__BlocksAssignment_3 : ( ruleComputationBlock ) ; + public final void rule__ComputationModel__BlocksAssignment_3() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2163:1: ( ( ruleComputationBlock ) ) - // InternalComputation.g:2164:2: ( ruleComputationBlock ) + // InternalComputation.g:2446:1: ( ( ruleComputationBlock ) ) + // InternalComputation.g:2447:2: ( ruleComputationBlock ) { - // InternalComputation.g:2164:2: ( ruleComputationBlock ) - // InternalComputation.g:2165:3: ruleComputationBlock + // InternalComputation.g:2447:2: ( ruleComputationBlock ) + // InternalComputation.g:2448:3: ruleComputationBlock { - before(grammarAccess.getComputationModelAccess().getBlocksComputationBlockParserRuleCall_2_0()); + before(grammarAccess.getComputationModelAccess().getBlocksComputationBlockParserRuleCall_3_0()); pushFollow(FOLLOW_2); ruleComputationBlock(); state._fsp--; - after(grammarAccess.getComputationModelAccess().getBlocksComputationBlockParserRuleCall_2_0()); + after(grammarAccess.getComputationModelAccess().getBlocksComputationBlockParserRuleCall_3_0()); } @@ -6593,21 +7463,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars } return ; } - // $ANTLR end "rule__ComputationModel__BlocksAssignment_2" + // $ANTLR end "rule__ComputationModel__BlocksAssignment_3" // $ANTLR start "rule__Parameter__NameAssignment_1" - // InternalComputation.g:2174:1: rule__Parameter__NameAssignment_1 : ( RULE_ID ) ; + // InternalComputation.g:2457:1: rule__Parameter__NameAssignment_1 : ( RULE_ID ) ; public final void rule__Parameter__NameAssignment_1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2178:1: ( ( RULE_ID ) ) - // InternalComputation.g:2179:2: ( RULE_ID ) + // InternalComputation.g:2461:1: ( ( RULE_ID ) ) + // InternalComputation.g:2462:2: ( RULE_ID ) { - // InternalComputation.g:2179:2: ( RULE_ID ) - // InternalComputation.g:2180:3: RULE_ID + // InternalComputation.g:2462:2: ( RULE_ID ) + // InternalComputation.g:2463:3: RULE_ID { before(grammarAccess.getParameterAccess().getNameIDTerminalRuleCall_1_0()); match(input,RULE_ID,FOLLOW_2); @@ -6634,17 +7504,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Parameter__ValueAssignment_3" - // InternalComputation.g:2189:1: rule__Parameter__ValueAssignment_3 : ( RULE_INT ) ; + // InternalComputation.g:2472:1: rule__Parameter__ValueAssignment_3 : ( RULE_INT ) ; public final void rule__Parameter__ValueAssignment_3() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2193:1: ( ( RULE_INT ) ) - // InternalComputation.g:2194:2: ( RULE_INT ) + // InternalComputation.g:2476:1: ( ( RULE_INT ) ) + // InternalComputation.g:2477:2: ( RULE_INT ) { - // InternalComputation.g:2194:2: ( RULE_INT ) - // InternalComputation.g:2195:3: RULE_INT + // InternalComputation.g:2477:2: ( RULE_INT ) + // InternalComputation.g:2478:3: RULE_INT { before(grammarAccess.getParameterAccess().getValueINTTerminalRuleCall_3_0()); match(input,RULE_INT,FOLLOW_2); @@ -6671,17 +7541,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__FrequencyAssignment_4" - // InternalComputation.g:2204:1: rule__HWTargetDesign__FrequencyAssignment_4 : ( RULE_INT ) ; + // InternalComputation.g:2487:1: rule__HWTargetDesign__FrequencyAssignment_4 : ( RULE_INT ) ; public final void rule__HWTargetDesign__FrequencyAssignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2208:1: ( ( RULE_INT ) ) - // InternalComputation.g:2209:2: ( RULE_INT ) + // InternalComputation.g:2491:1: ( ( RULE_INT ) ) + // InternalComputation.g:2492:2: ( RULE_INT ) { - // InternalComputation.g:2209:2: ( RULE_INT ) - // InternalComputation.g:2210:3: RULE_INT + // InternalComputation.g:2492:2: ( RULE_INT ) + // InternalComputation.g:2493:3: RULE_INT { before(grammarAccess.getHWTargetDesignAccess().getFrequencyINTTerminalRuleCall_4_0()); match(input,RULE_INT,FOLLOW_2); @@ -6708,17 +7578,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__OutputsPerCycleAssignment_7" - // InternalComputation.g:2219:1: rule__HWTargetDesign__OutputsPerCycleAssignment_7 : ( RULE_INT ) ; + // InternalComputation.g:2502:1: rule__HWTargetDesign__OutputsPerCycleAssignment_7 : ( RULE_INT ) ; public final void rule__HWTargetDesign__OutputsPerCycleAssignment_7() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2223:1: ( ( RULE_INT ) ) - // InternalComputation.g:2224:2: ( RULE_INT ) + // InternalComputation.g:2506:1: ( ( RULE_INT ) ) + // InternalComputation.g:2507:2: ( RULE_INT ) { - // InternalComputation.g:2224:2: ( RULE_INT ) - // InternalComputation.g:2225:3: RULE_INT + // InternalComputation.g:2507:2: ( RULE_INT ) + // InternalComputation.g:2508:3: RULE_INT { before(grammarAccess.getHWTargetDesignAccess().getOutputsPerCycleINTTerminalRuleCall_7_0()); match(input,RULE_INT,FOLLOW_2); @@ -6745,17 +7615,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__HWTargetDesign__ProblemSizeExprAssignment_10" - // InternalComputation.g:2234:1: rule__HWTargetDesign__ProblemSizeExprAssignment_10 : ( ruleSummationExpression ) ; + // InternalComputation.g:2517:1: rule__HWTargetDesign__ProblemSizeExprAssignment_10 : ( ruleSummationExpression ) ; public final void rule__HWTargetDesign__ProblemSizeExprAssignment_10() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2238:1: ( ( ruleSummationExpression ) ) - // InternalComputation.g:2239:2: ( ruleSummationExpression ) + // InternalComputation.g:2521:1: ( ( ruleSummationExpression ) ) + // InternalComputation.g:2522:2: ( ruleSummationExpression ) { - // InternalComputation.g:2239:2: ( ruleSummationExpression ) - // InternalComputation.g:2240:3: ruleSummationExpression + // InternalComputation.g:2522:2: ( ruleSummationExpression ) + // InternalComputation.g:2523:3: ruleSummationExpression { before(grammarAccess.getHWTargetDesignAccess().getProblemSizeExprSummationExpressionParserRuleCall_10_0()); pushFollow(FOLLOW_2); @@ -6785,18 +7655,145 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR end "rule__HWTargetDesign__ProblemSizeExprAssignment_10" + // $ANTLR start "rule__BlockGroup__NameAssignment_1" + // InternalComputation.g:2532:1: rule__BlockGroup__NameAssignment_1 : ( RULE_ID ) ; + public final void rule__BlockGroup__NameAssignment_1() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:2536:1: ( ( RULE_ID ) ) + // InternalComputation.g:2537:2: ( RULE_ID ) + { + // InternalComputation.g:2537:2: ( RULE_ID ) + // InternalComputation.g:2538:3: RULE_ID + { + before(grammarAccess.getBlockGroupAccess().getNameIDTerminalRuleCall_1_0()); + match(input,RULE_ID,FOLLOW_2); + after(grammarAccess.getBlockGroupAccess().getNameIDTerminalRuleCall_1_0()); + + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__NameAssignment_1" + + + // $ANTLR start "rule__BlockGroup__BlocksAssignment_3" + // InternalComputation.g:2547:1: rule__BlockGroup__BlocksAssignment_3 : ( ( RULE_ID ) ) ; + public final void rule__BlockGroup__BlocksAssignment_3() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:2551:1: ( ( ( RULE_ID ) ) ) + // InternalComputation.g:2552:2: ( ( RULE_ID ) ) + { + // InternalComputation.g:2552:2: ( ( RULE_ID ) ) + // InternalComputation.g:2553:3: ( RULE_ID ) + { + before(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockCrossReference_3_0()); + // InternalComputation.g:2554:3: ( RULE_ID ) + // InternalComputation.g:2555:4: RULE_ID + { + before(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockIDTerminalRuleCall_3_0_1()); + match(input,RULE_ID,FOLLOW_2); + after(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockIDTerminalRuleCall_3_0_1()); + + } + + after(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockCrossReference_3_0()); + + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__BlocksAssignment_3" + + + // $ANTLR start "rule__BlockGroup__BlocksAssignment_4_1" + // InternalComputation.g:2566:1: rule__BlockGroup__BlocksAssignment_4_1 : ( ( RULE_ID ) ) ; + public final void rule__BlockGroup__BlocksAssignment_4_1() throws RecognitionException { + + int stackSize = keepStackSize(); + + try { + // InternalComputation.g:2570:1: ( ( ( RULE_ID ) ) ) + // InternalComputation.g:2571:2: ( ( RULE_ID ) ) + { + // InternalComputation.g:2571:2: ( ( RULE_ID ) ) + // InternalComputation.g:2572:3: ( RULE_ID ) + { + before(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockCrossReference_4_1_0()); + // InternalComputation.g:2573:3: ( RULE_ID ) + // InternalComputation.g:2574:4: RULE_ID + { + before(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockIDTerminalRuleCall_4_1_0_1()); + match(input,RULE_ID,FOLLOW_2); + after(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockIDTerminalRuleCall_4_1_0_1()); + + } + + after(grammarAccess.getBlockGroupAccess().getBlocksComputationBlockCrossReference_4_1_0()); + + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + + restoreStackSize(stackSize); + + } + return ; + } + // $ANTLR end "rule__BlockGroup__BlocksAssignment_4_1" + + // $ANTLR start "rule__ComputationBlock__NameAssignment_1" - // InternalComputation.g:2249:1: rule__ComputationBlock__NameAssignment_1 : ( RULE_ID ) ; + // InternalComputation.g:2585:1: rule__ComputationBlock__NameAssignment_1 : ( RULE_ID ) ; public final void rule__ComputationBlock__NameAssignment_1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2253:1: ( ( RULE_ID ) ) - // InternalComputation.g:2254:2: ( RULE_ID ) + // InternalComputation.g:2589:1: ( ( RULE_ID ) ) + // InternalComputation.g:2590:2: ( RULE_ID ) { - // InternalComputation.g:2254:2: ( RULE_ID ) - // InternalComputation.g:2255:3: RULE_ID + // InternalComputation.g:2590:2: ( RULE_ID ) + // InternalComputation.g:2591:3: RULE_ID { before(grammarAccess.getComputationBlockAccess().getNameIDTerminalRuleCall_1_0()); match(input,RULE_ID,FOLLOW_2); @@ -6823,17 +7820,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ComputationBlock__OperationsAssignment_3" - // InternalComputation.g:2264:1: rule__ComputationBlock__OperationsAssignment_3 : ( ruleOperation ) ; + // InternalComputation.g:2600:1: rule__ComputationBlock__OperationsAssignment_3 : ( ruleOperation ) ; public final void rule__ComputationBlock__OperationsAssignment_3() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2268:1: ( ( ruleOperation ) ) - // InternalComputation.g:2269:2: ( ruleOperation ) + // InternalComputation.g:2604:1: ( ( ruleOperation ) ) + // InternalComputation.g:2605:2: ( ruleOperation ) { - // InternalComputation.g:2269:2: ( ruleOperation ) - // InternalComputation.g:2270:3: ruleOperation + // InternalComputation.g:2605:2: ( ruleOperation ) + // InternalComputation.g:2606:3: ruleOperation { before(grammarAccess.getComputationBlockAccess().getOperationsOperationParserRuleCall_3_0()); pushFollow(FOLLOW_2); @@ -6864,17 +7861,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__OpTypeAssignment_0" - // InternalComputation.g:2279:1: rule__Operation__OpTypeAssignment_0 : ( ruleOP ) ; + // InternalComputation.g:2615:1: rule__Operation__OpTypeAssignment_0 : ( ruleOP ) ; public final void rule__Operation__OpTypeAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2283:1: ( ( ruleOP ) ) - // InternalComputation.g:2284:2: ( ruleOP ) + // InternalComputation.g:2619:1: ( ( ruleOP ) ) + // InternalComputation.g:2620:2: ( ruleOP ) { - // InternalComputation.g:2284:2: ( ruleOP ) - // InternalComputation.g:2285:3: ruleOP + // InternalComputation.g:2620:2: ( ruleOP ) + // InternalComputation.g:2621:3: ruleOP { before(grammarAccess.getOperationAccess().getOpTypeOPParserRuleCall_0_0()); pushFollow(FOLLOW_2); @@ -6905,17 +7902,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__OutputExprAssignment_2" - // InternalComputation.g:2294:1: rule__Operation__OutputExprAssignment_2 : ( ruleOperandExpression ) ; + // InternalComputation.g:2630:1: rule__Operation__OutputExprAssignment_2 : ( ruleOperandExpression ) ; public final void rule__Operation__OutputExprAssignment_2() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2298:1: ( ( ruleOperandExpression ) ) - // InternalComputation.g:2299:2: ( ruleOperandExpression ) + // InternalComputation.g:2634:1: ( ( ruleOperandExpression ) ) + // InternalComputation.g:2635:2: ( ruleOperandExpression ) { - // InternalComputation.g:2299:2: ( ruleOperandExpression ) - // InternalComputation.g:2300:3: ruleOperandExpression + // InternalComputation.g:2635:2: ( ruleOperandExpression ) + // InternalComputation.g:2636:3: ruleOperandExpression { before(grammarAccess.getOperationAccess().getOutputExprOperandExpressionParserRuleCall_2_0()); pushFollow(FOLLOW_2); @@ -6946,17 +7943,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__InputExpr1Assignment_4" - // InternalComputation.g:2309:1: rule__Operation__InputExpr1Assignment_4 : ( ruleOperandExpression ) ; + // InternalComputation.g:2645:1: rule__Operation__InputExpr1Assignment_4 : ( ruleOperandExpression ) ; public final void rule__Operation__InputExpr1Assignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2313:1: ( ( ruleOperandExpression ) ) - // InternalComputation.g:2314:2: ( ruleOperandExpression ) + // InternalComputation.g:2649:1: ( ( ruleOperandExpression ) ) + // InternalComputation.g:2650:2: ( ruleOperandExpression ) { - // InternalComputation.g:2314:2: ( ruleOperandExpression ) - // InternalComputation.g:2315:3: ruleOperandExpression + // InternalComputation.g:2650:2: ( ruleOperandExpression ) + // InternalComputation.g:2651:3: ruleOperandExpression { before(grammarAccess.getOperationAccess().getInputExpr1OperandExpressionParserRuleCall_4_0()); pushFollow(FOLLOW_2); @@ -6987,17 +7984,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__InputExpr2Assignment_6" - // InternalComputation.g:2324:1: rule__Operation__InputExpr2Assignment_6 : ( ruleOperandExpression ) ; + // InternalComputation.g:2660:1: rule__Operation__InputExpr2Assignment_6 : ( ruleOperandExpression ) ; public final void rule__Operation__InputExpr2Assignment_6() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2328:1: ( ( ruleOperandExpression ) ) - // InternalComputation.g:2329:2: ( ruleOperandExpression ) + // InternalComputation.g:2664:1: ( ( ruleOperandExpression ) ) + // InternalComputation.g:2665:2: ( ruleOperandExpression ) { - // InternalComputation.g:2329:2: ( ruleOperandExpression ) - // InternalComputation.g:2330:3: ruleOperandExpression + // InternalComputation.g:2665:2: ( ruleOperandExpression ) + // InternalComputation.g:2666:3: ruleOperandExpression { before(grammarAccess.getOperationAccess().getInputExpr2OperandExpressionParserRuleCall_6_0()); pushFollow(FOLLOW_2); @@ -7028,17 +8025,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__Operation__NumOpsAssignment_8" - // InternalComputation.g:2339:1: rule__Operation__NumOpsAssignment_8 : ( ruleSummationExpression ) ; + // InternalComputation.g:2675:1: rule__Operation__NumOpsAssignment_8 : ( ruleSummationExpression ) ; public final void rule__Operation__NumOpsAssignment_8() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2343:1: ( ( ruleSummationExpression ) ) - // InternalComputation.g:2344:2: ( ruleSummationExpression ) + // InternalComputation.g:2679:1: ( ( ruleSummationExpression ) ) + // InternalComputation.g:2680:2: ( ruleSummationExpression ) { - // InternalComputation.g:2344:2: ( ruleSummationExpression ) - // InternalComputation.g:2345:3: ruleSummationExpression + // InternalComputation.g:2680:2: ( ruleSummationExpression ) + // InternalComputation.g:2681:3: ruleSummationExpression { before(grammarAccess.getOperationAccess().getNumOpsSummationExpressionParserRuleCall_8_0()); pushFollow(FOLLOW_2); @@ -7069,17 +8066,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__ExprsAssignment_2" - // InternalComputation.g:2354:1: rule__MaxExpression__ExprsAssignment_2 : ( ruleTerminalOperandExpression ) ; + // InternalComputation.g:2690:1: rule__MaxExpression__ExprsAssignment_2 : ( ruleTerminalOperandExpression ) ; public final void rule__MaxExpression__ExprsAssignment_2() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2358:1: ( ( ruleTerminalOperandExpression ) ) - // InternalComputation.g:2359:2: ( ruleTerminalOperandExpression ) + // InternalComputation.g:2694:1: ( ( ruleTerminalOperandExpression ) ) + // InternalComputation.g:2695:2: ( ruleTerminalOperandExpression ) { - // InternalComputation.g:2359:2: ( ruleTerminalOperandExpression ) - // InternalComputation.g:2360:3: ruleTerminalOperandExpression + // InternalComputation.g:2695:2: ( ruleTerminalOperandExpression ) + // InternalComputation.g:2696:3: ruleTerminalOperandExpression { before(grammarAccess.getMaxExpressionAccess().getExprsTerminalOperandExpressionParserRuleCall_2_0()); pushFollow(FOLLOW_2); @@ -7110,17 +8107,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__MaxExpression__ExprsAssignment_3_1" - // InternalComputation.g:2369:1: rule__MaxExpression__ExprsAssignment_3_1 : ( ruleTerminalOperandExpression ) ; + // InternalComputation.g:2705:1: rule__MaxExpression__ExprsAssignment_3_1 : ( ruleTerminalOperandExpression ) ; public final void rule__MaxExpression__ExprsAssignment_3_1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2373:1: ( ( ruleTerminalOperandExpression ) ) - // InternalComputation.g:2374:2: ( ruleTerminalOperandExpression ) + // InternalComputation.g:2709:1: ( ( ruleTerminalOperandExpression ) ) + // InternalComputation.g:2710:2: ( ruleTerminalOperandExpression ) { - // InternalComputation.g:2374:2: ( ruleTerminalOperandExpression ) - // InternalComputation.g:2375:3: ruleTerminalOperandExpression + // InternalComputation.g:2710:2: ( ruleTerminalOperandExpression ) + // InternalComputation.g:2711:3: ruleTerminalOperandExpression { before(grammarAccess.getMaxExpressionAccess().getExprsTerminalOperandExpressionParserRuleCall_3_1_0()); pushFollow(FOLLOW_2); @@ -7151,17 +8148,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__AddExpression__Op1Assignment_1" - // InternalComputation.g:2384:1: rule__AddExpression__Op1Assignment_1 : ( ruleOperandExpression ) ; + // InternalComputation.g:2720:1: rule__AddExpression__Op1Assignment_1 : ( ruleOperandExpression ) ; public final void rule__AddExpression__Op1Assignment_1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2388:1: ( ( ruleOperandExpression ) ) - // InternalComputation.g:2389:2: ( ruleOperandExpression ) + // InternalComputation.g:2724:1: ( ( ruleOperandExpression ) ) + // InternalComputation.g:2725:2: ( ruleOperandExpression ) { - // InternalComputation.g:2389:2: ( ruleOperandExpression ) - // InternalComputation.g:2390:3: ruleOperandExpression + // InternalComputation.g:2725:2: ( ruleOperandExpression ) + // InternalComputation.g:2726:3: ruleOperandExpression { before(grammarAccess.getAddExpressionAccess().getOp1OperandExpressionParserRuleCall_1_0()); pushFollow(FOLLOW_2); @@ -7192,17 +8189,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__AddExpression__Op2Assignment_3" - // InternalComputation.g:2399:1: rule__AddExpression__Op2Assignment_3 : ( ruleOperandExpression ) ; + // InternalComputation.g:2735:1: rule__AddExpression__Op2Assignment_3 : ( ruleOperandExpression ) ; public final void rule__AddExpression__Op2Assignment_3() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2403:1: ( ( ruleOperandExpression ) ) - // InternalComputation.g:2404:2: ( ruleOperandExpression ) + // InternalComputation.g:2739:1: ( ( ruleOperandExpression ) ) + // InternalComputation.g:2740:2: ( ruleOperandExpression ) { - // InternalComputation.g:2404:2: ( ruleOperandExpression ) - // InternalComputation.g:2405:3: ruleOperandExpression + // InternalComputation.g:2740:2: ( ruleOperandExpression ) + // InternalComputation.g:2741:3: ruleOperandExpression { before(grammarAccess.getAddExpressionAccess().getOp2OperandExpressionParserRuleCall_3_0()); pushFollow(FOLLOW_2); @@ -7233,17 +8230,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__OperandTerm__CoefAssignment_0" - // InternalComputation.g:2414:1: rule__OperandTerm__CoefAssignment_0 : ( RULE_INT ) ; + // InternalComputation.g:2750:1: rule__OperandTerm__CoefAssignment_0 : ( RULE_INT ) ; public final void rule__OperandTerm__CoefAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2418:1: ( ( RULE_INT ) ) - // InternalComputation.g:2419:2: ( RULE_INT ) + // InternalComputation.g:2754:1: ( ( RULE_INT ) ) + // InternalComputation.g:2755:2: ( RULE_INT ) { - // InternalComputation.g:2419:2: ( RULE_INT ) - // InternalComputation.g:2420:3: RULE_INT + // InternalComputation.g:2755:2: ( RULE_INT ) + // InternalComputation.g:2756:3: RULE_INT { before(grammarAccess.getOperandTermAccess().getCoefINTTerminalRuleCall_0_0()); match(input,RULE_INT,FOLLOW_2); @@ -7270,17 +8267,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__OperandTerm__NameAssignment_1" - // InternalComputation.g:2429:1: rule__OperandTerm__NameAssignment_1 : ( RULE_ID ) ; + // InternalComputation.g:2765:1: rule__OperandTerm__NameAssignment_1 : ( RULE_ID ) ; public final void rule__OperandTerm__NameAssignment_1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2433:1: ( ( RULE_ID ) ) - // InternalComputation.g:2434:2: ( RULE_ID ) + // InternalComputation.g:2769:1: ( ( RULE_ID ) ) + // InternalComputation.g:2770:2: ( RULE_ID ) { - // InternalComputation.g:2434:2: ( RULE_ID ) - // InternalComputation.g:2435:3: RULE_ID + // InternalComputation.g:2770:2: ( RULE_ID ) + // InternalComputation.g:2771:3: RULE_ID { before(grammarAccess.getOperandTermAccess().getNameIDTerminalRuleCall_1_0()); match(input,RULE_ID,FOLLOW_2); @@ -7307,17 +8304,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__TermsAssignment_0_0_0" - // InternalComputation.g:2444:1: rule__SummationExpression__TermsAssignment_0_0_0 : ( ruleProductExpression ) ; + // InternalComputation.g:2780:1: rule__SummationExpression__TermsAssignment_0_0_0 : ( ruleProductExpression ) ; public final void rule__SummationExpression__TermsAssignment_0_0_0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2448:1: ( ( ruleProductExpression ) ) - // InternalComputation.g:2449:2: ( ruleProductExpression ) + // InternalComputation.g:2784:1: ( ( ruleProductExpression ) ) + // InternalComputation.g:2785:2: ( ruleProductExpression ) { - // InternalComputation.g:2449:2: ( ruleProductExpression ) - // InternalComputation.g:2450:3: ruleProductExpression + // InternalComputation.g:2785:2: ( ruleProductExpression ) + // InternalComputation.g:2786:3: ruleProductExpression { before(grammarAccess.getSummationExpressionAccess().getTermsProductExpressionParserRuleCall_0_0_0_0()); pushFollow(FOLLOW_2); @@ -7348,17 +8345,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__TermsAssignment_0_0_1_1" - // InternalComputation.g:2459:1: rule__SummationExpression__TermsAssignment_0_0_1_1 : ( ruleProductExpression ) ; + // InternalComputation.g:2795:1: rule__SummationExpression__TermsAssignment_0_0_1_1 : ( ruleProductExpression ) ; public final void rule__SummationExpression__TermsAssignment_0_0_1_1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2463:1: ( ( ruleProductExpression ) ) - // InternalComputation.g:2464:2: ( ruleProductExpression ) + // InternalComputation.g:2799:1: ( ( ruleProductExpression ) ) + // InternalComputation.g:2800:2: ( ruleProductExpression ) { - // InternalComputation.g:2464:2: ( ruleProductExpression ) - // InternalComputation.g:2465:3: ruleProductExpression + // InternalComputation.g:2800:2: ( ruleProductExpression ) + // InternalComputation.g:2801:3: ruleProductExpression { before(grammarAccess.getSummationExpressionAccess().getTermsProductExpressionParserRuleCall_0_0_1_1_0()); pushFollow(FOLLOW_2); @@ -7389,17 +8386,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__ConstantAssignment_0_1_1" - // InternalComputation.g:2474:1: rule__SummationExpression__ConstantAssignment_0_1_1 : ( RULE_INT ) ; + // InternalComputation.g:2810:1: rule__SummationExpression__ConstantAssignment_0_1_1 : ( RULE_INT ) ; public final void rule__SummationExpression__ConstantAssignment_0_1_1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2478:1: ( ( RULE_INT ) ) - // InternalComputation.g:2479:2: ( RULE_INT ) + // InternalComputation.g:2814:1: ( ( RULE_INT ) ) + // InternalComputation.g:2815:2: ( RULE_INT ) { - // InternalComputation.g:2479:2: ( RULE_INT ) - // InternalComputation.g:2480:3: RULE_INT + // InternalComputation.g:2815:2: ( RULE_INT ) + // InternalComputation.g:2816:3: RULE_INT { before(grammarAccess.getSummationExpressionAccess().getConstantINTTerminalRuleCall_0_1_1_0()); match(input,RULE_INT,FOLLOW_2); @@ -7426,17 +8423,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__SummationExpression__ConstantAssignment_1" - // InternalComputation.g:2489:1: rule__SummationExpression__ConstantAssignment_1 : ( RULE_INT ) ; + // InternalComputation.g:2825:1: rule__SummationExpression__ConstantAssignment_1 : ( RULE_INT ) ; public final void rule__SummationExpression__ConstantAssignment_1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2493:1: ( ( RULE_INT ) ) - // InternalComputation.g:2494:2: ( RULE_INT ) + // InternalComputation.g:2829:1: ( ( RULE_INT ) ) + // InternalComputation.g:2830:2: ( RULE_INT ) { - // InternalComputation.g:2494:2: ( RULE_INT ) - // InternalComputation.g:2495:3: RULE_INT + // InternalComputation.g:2830:2: ( RULE_INT ) + // InternalComputation.g:2831:3: RULE_INT { before(grammarAccess.getSummationExpressionAccess().getConstantINTTerminalRuleCall_1_0()); match(input,RULE_INT,FOLLOW_2); @@ -7463,17 +8460,17 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ProductExpression__ConstantAssignment_0" - // InternalComputation.g:2504:1: rule__ProductExpression__ConstantAssignment_0 : ( RULE_INT ) ; + // InternalComputation.g:2840:1: rule__ProductExpression__ConstantAssignment_0 : ( RULE_INT ) ; public final void rule__ProductExpression__ConstantAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2508:1: ( ( RULE_INT ) ) - // InternalComputation.g:2509:2: ( RULE_INT ) + // InternalComputation.g:2844:1: ( ( RULE_INT ) ) + // InternalComputation.g:2845:2: ( RULE_INT ) { - // InternalComputation.g:2509:2: ( RULE_INT ) - // InternalComputation.g:2510:3: RULE_INT + // InternalComputation.g:2845:2: ( RULE_INT ) + // InternalComputation.g:2846:3: RULE_INT { before(grammarAccess.getProductExpressionAccess().getConstantINTTerminalRuleCall_0_0()); match(input,RULE_INT,FOLLOW_2); @@ -7500,21 +8497,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ProductExpression__TermsAssignment_1_0" - // InternalComputation.g:2519:1: rule__ProductExpression__TermsAssignment_1_0 : ( ( RULE_ID ) ) ; + // InternalComputation.g:2855:1: rule__ProductExpression__TermsAssignment_1_0 : ( ( RULE_ID ) ) ; public final void rule__ProductExpression__TermsAssignment_1_0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2523:1: ( ( ( RULE_ID ) ) ) - // InternalComputation.g:2524:2: ( ( RULE_ID ) ) + // InternalComputation.g:2859:1: ( ( ( RULE_ID ) ) ) + // InternalComputation.g:2860:2: ( ( RULE_ID ) ) { - // InternalComputation.g:2524:2: ( ( RULE_ID ) ) - // InternalComputation.g:2525:3: ( RULE_ID ) + // InternalComputation.g:2860:2: ( ( RULE_ID ) ) + // InternalComputation.g:2861:3: ( RULE_ID ) { before(grammarAccess.getProductExpressionAccess().getTermsParameterCrossReference_1_0_0()); - // InternalComputation.g:2526:3: ( RULE_ID ) - // InternalComputation.g:2527:4: RULE_ID + // InternalComputation.g:2862:3: ( RULE_ID ) + // InternalComputation.g:2863:4: RULE_ID { before(grammarAccess.getProductExpressionAccess().getTermsParameterIDTerminalRuleCall_1_0_0_1()); match(input,RULE_ID,FOLLOW_2); @@ -7545,21 +8542,21 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars // $ANTLR start "rule__ProductExpression__TermsAssignment_1_1" - // InternalComputation.g:2538:1: rule__ProductExpression__TermsAssignment_1_1 : ( ( RULE_ID ) ) ; + // InternalComputation.g:2874:1: rule__ProductExpression__TermsAssignment_1_1 : ( ( RULE_ID ) ) ; public final void rule__ProductExpression__TermsAssignment_1_1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalComputation.g:2542:1: ( ( ( RULE_ID ) ) ) - // InternalComputation.g:2543:2: ( ( RULE_ID ) ) + // InternalComputation.g:2878:1: ( ( ( RULE_ID ) ) ) + // InternalComputation.g:2879:2: ( ( RULE_ID ) ) { - // InternalComputation.g:2543:2: ( ( RULE_ID ) ) - // InternalComputation.g:2544:3: ( RULE_ID ) + // InternalComputation.g:2879:2: ( ( RULE_ID ) ) + // InternalComputation.g:2880:3: ( RULE_ID ) { before(grammarAccess.getProductExpressionAccess().getTermsParameterCrossReference_1_1_0()); - // InternalComputation.g:2545:3: ( RULE_ID ) - // InternalComputation.g:2546:4: RULE_ID + // InternalComputation.g:2881:3: ( RULE_ID ) + // InternalComputation.g:2882:4: RULE_ID { before(grammarAccess.getProductExpressionAccess().getTermsParameterIDTerminalRuleCall_1_1_0_1()); match(input,RULE_ID,FOLLOW_2); @@ -7597,30 +8594,32 @@ public class InternalComputationParser extends AbstractInternalContentAssistPars public static final BitSet FOLLOW_2 = new BitSet(new long[]{0x0000000000000002L}); public static final BitSet FOLLOW_3 = new BitSet(new long[]{0x0000000000010000L}); public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000002002L}); - public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x0000000000400000L}); + public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x0000000001400000L}); public static final BitSet FOLLOW_6 = new BitSet(new long[]{0x0000000000400002L}); - public static final BitSet FOLLOW_7 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_8 = new BitSet(new long[]{0x0000000000004000L}); - public static final BitSet FOLLOW_9 = new BitSet(new long[]{0x0000000000000020L}); - public static final BitSet FOLLOW_10 = new BitSet(new long[]{0x0000000000008000L}); - public static final BitSet FOLLOW_11 = new BitSet(new long[]{0x0000000000020000L}); - public static final BitSet FOLLOW_12 = new BitSet(new long[]{0x0000000000040000L}); - public static final BitSet FOLLOW_13 = new BitSet(new long[]{0x0000000000080000L}); - public static final BitSet FOLLOW_14 = new BitSet(new long[]{0x0000000000100000L}); - public static final BitSet FOLLOW_15 = new BitSet(new long[]{0x0000000000000030L}); - public static final BitSet FOLLOW_16 = new BitSet(new long[]{0x0000000000200000L}); - public static final BitSet FOLLOW_17 = new BitSet(new long[]{0x0000000000001800L}); - public static final BitSet FOLLOW_18 = new BitSet(new long[]{0x0000000000001802L}); - public static final BitSet FOLLOW_19 = new BitSet(new long[]{0x0000000000800000L}); - public static final BitSet FOLLOW_20 = new BitSet(new long[]{0x000000000C000030L}); - public static final BitSet FOLLOW_21 = new BitSet(new long[]{0x0000000001000000L}); + public static final BitSet FOLLOW_7 = new BitSet(new long[]{0x0000000001400002L}); + public static final BitSet FOLLOW_8 = new BitSet(new long[]{0x0000000000000010L}); + public static final BitSet FOLLOW_9 = new BitSet(new long[]{0x0000000000004000L}); + public static final BitSet FOLLOW_10 = new BitSet(new long[]{0x0000000000000020L}); + public static final BitSet FOLLOW_11 = new BitSet(new long[]{0x0000000000008000L}); + public static final BitSet FOLLOW_12 = new BitSet(new long[]{0x0000000000020000L}); + public static final BitSet FOLLOW_13 = new BitSet(new long[]{0x0000000000040000L}); + public static final BitSet FOLLOW_14 = new BitSet(new long[]{0x0000000000080000L}); + public static final BitSet FOLLOW_15 = new BitSet(new long[]{0x0000000000100000L}); + public static final BitSet FOLLOW_16 = new BitSet(new long[]{0x0000000000000030L}); + public static final BitSet FOLLOW_17 = new BitSet(new long[]{0x0000000000200000L}); + public static final BitSet FOLLOW_18 = new BitSet(new long[]{0x0000000000A00000L}); + public static final BitSet FOLLOW_19 = new BitSet(new long[]{0x0000000000800002L}); + public static final BitSet FOLLOW_20 = new BitSet(new long[]{0x0000000000001800L}); + public static final BitSet FOLLOW_21 = new BitSet(new long[]{0x0000000000001802L}); public static final BitSet FOLLOW_22 = new BitSet(new long[]{0x0000000002000000L}); - public static final BitSet FOLLOW_23 = new BitSet(new long[]{0x0000000008000000L}); - public static final BitSet FOLLOW_24 = new BitSet(new long[]{0x0000000020000000L}); - public static final BitSet FOLLOW_25 = new BitSet(new long[]{0x0000000010000000L}); - public static final BitSet FOLLOW_26 = new BitSet(new long[]{0x0000000020000002L}); - public static final BitSet FOLLOW_27 = new BitSet(new long[]{0x0000000040000000L}); - public static final BitSet FOLLOW_28 = new BitSet(new long[]{0x0000000040000002L}); - public static final BitSet FOLLOW_29 = new BitSet(new long[]{0x0000000000000012L}); + public static final BitSet FOLLOW_23 = new BitSet(new long[]{0x0000000030000030L}); + public static final BitSet FOLLOW_24 = new BitSet(new long[]{0x0000000004000000L}); + public static final BitSet FOLLOW_25 = new BitSet(new long[]{0x0000000008000000L}); + public static final BitSet FOLLOW_26 = new BitSet(new long[]{0x0000000020000000L}); + public static final BitSet FOLLOW_27 = new BitSet(new long[]{0x0000000000800000L}); + public static final BitSet FOLLOW_28 = new BitSet(new long[]{0x0000000040000000L}); + public static final BitSet FOLLOW_29 = new BitSet(new long[]{0x0000000080000000L}); + public static final BitSet FOLLOW_30 = new BitSet(new long[]{0x0000000080000002L}); + public static final BitSet FOLLOW_31 = new BitSet(new long[]{0x0000000000000012L}); } \ No newline at end of file diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ui/src-gen/fr/irisa/cairn/gecos/typeexploration/ui/contentassist/AbstractComputationProposalProvider.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ui/src-gen/fr/irisa/cairn/gecos/typeexploration/ui/contentassist/AbstractComputationProposalProvider.java index deca2bebe38f44533a3439b50be0fdf7796c4d3d..145762849b5a64ff1670df3d79f0becc7a1b9f38 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ui/src-gen/fr/irisa/cairn/gecos/typeexploration/ui/contentassist/AbstractComputationProposalProvider.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext.ui/src-gen/fr/irisa/cairn/gecos/typeexploration/ui/contentassist/AbstractComputationProposalProvider.java @@ -24,6 +24,9 @@ public abstract class AbstractComputationProposalProvider extends TerminalsPropo public void completeComputationModel_TargetDesign(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } + public void completeComputationModel_BlockGroups(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { + completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); + } public void completeComputationModel_Blocks(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } @@ -42,6 +45,12 @@ public abstract class AbstractComputationProposalProvider extends TerminalsPropo public void completeHWTargetDesign_ProblemSizeExpr(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } + public void completeBlockGroup_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { + completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); + } + public void completeBlockGroup_Blocks(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { + lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor); + } public void completeComputationBlock_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } @@ -100,6 +109,9 @@ public abstract class AbstractComputationProposalProvider extends TerminalsPropo public void complete_HWTargetDesign(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } + public void complete_BlockGroup(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { + // subclasses may override + } public void complete_ComputationBlock(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/Computation.xtextbin b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/Computation.xtextbin index d1d50bf5fef734dbf56f299c83788e78962b5804..2da8cf7ac53c54b2c24637171a8bbb9875297fa5 100644 Binary files a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/Computation.xtextbin and b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/Computation.xtextbin differ diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputation.g b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputation.g index 0573680322f6ec92a42e85efa7d2658d48c727de..79a2122d0df748d2cf9aa259d9c278c3d745253d 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputation.g +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputation.g @@ -117,9 +117,28 @@ ruleComputationModel returns [EObject current=null] ( ( { - newCompositeNode(grammarAccess.getComputationModelAccess().getBlocksComputationBlockParserRuleCall_2_0()); + newCompositeNode(grammarAccess.getComputationModelAccess().getBlockGroupsBlockGroupParserRuleCall_2_0()); } - lv_blocks_2_0=ruleComputationBlock + lv_blockGroups_2_0=ruleBlockGroup + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getComputationModelRule()); + } + add( + $current, + "blockGroups", + lv_blockGroups_2_0, + "fr.irisa.cairn.gecos.typeexploration.Computation.BlockGroup"); + afterParserOrEnumRuleCall(); + } + ) + )* + ( + ( + { + newCompositeNode(grammarAccess.getComputationModelAccess().getBlocksComputationBlockParserRuleCall_3_0()); + } + lv_blocks_3_0=ruleComputationBlock { if ($current==null) { $current = createModelElementForParent(grammarAccess.getComputationModelRule()); @@ -127,7 +146,7 @@ ruleComputationModel returns [EObject current=null] add( $current, "blocks", - lv_blocks_2_0, + lv_blocks_3_0, "fr.irisa.cairn.gecos.typeexploration.Computation.ComputationBlock"); afterParserOrEnumRuleCall(); } @@ -313,6 +332,87 @@ ruleHWTargetDesign returns [EObject current=null] ) ; +// Entry rule entryRuleBlockGroup +entryRuleBlockGroup returns [EObject current=null]: + { newCompositeNode(grammarAccess.getBlockGroupRule()); } + iv_ruleBlockGroup=ruleBlockGroup + { $current=$iv_ruleBlockGroup.current; } + EOF; + +// Rule BlockGroup +ruleBlockGroup returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='group' + { + newLeafNode(otherlv_0, grammarAccess.getBlockGroupAccess().getGroupKeyword_0()); + } + ( + ( + lv_name_1_0=RULE_ID + { + newLeafNode(lv_name_1_0, grammarAccess.getBlockGroupAccess().getNameIDTerminalRuleCall_1_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getBlockGroupRule()); + } + setWithLastConsumed( + $current, + "name", + lv_name_1_0, + "org.eclipse.xtext.common.Terminals.ID"); + } + ) + ) + otherlv_2='{' + { + newLeafNode(otherlv_2, grammarAccess.getBlockGroupAccess().getLeftCurlyBracketKeyword_2()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getBlockGroupRule()); + } + } + otherlv_3=RULE_ID + { + newLeafNode(otherlv_3, grammarAccess.getBlockGroupAccess().getBlocksComputationBlockCrossReference_3_0()); + } + ) + ) + ( + otherlv_4=',' + { + newLeafNode(otherlv_4, grammarAccess.getBlockGroupAccess().getCommaKeyword_4_0()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getBlockGroupRule()); + } + } + otherlv_5=RULE_ID + { + newLeafNode(otherlv_5, grammarAccess.getBlockGroupAccess().getBlocksComputationBlockCrossReference_4_1_0()); + } + ) + ) + )* + otherlv_6='}' + { + newLeafNode(otherlv_6, grammarAccess.getBlockGroupAccess().getRightCurlyBracketKeyword_5()); + } + ) +; + // Entry rule entryRuleComputationBlock entryRuleComputationBlock returns [EObject current=null]: { newCompositeNode(grammarAccess.getComputationBlockRule()); } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputation.tokens b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputation.tokens index 7daeeecfe728656ac16b4b896ffa541f78ad661d..dfba79ce87ef15394d1702f2b8e06c8b525a87b3 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputation.tokens +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputation.tokens @@ -1,21 +1,22 @@ -'('=27 -')'=29 -'+'=30 -','=28 -':'=23 +'('=29 +')'=30 +'+'=31 +','=21 +':'=25 ';'=13 '='=12 -'ADD'=21 -'MUL'=22 -'block'=20 +'ADD'=23 +'MUL'=24 +'block'=22 'frequency'=16 -'max'=26 -'op'=24 +'group'=20 +'max'=28 +'op'=26 'outputsPerCycle'=17 'param'=11 'problemSize'=18 'target'=14 -'x'=25 +'x'=27 '{'=15 '}'=19 RULE_ANY_OTHER=10 @@ -45,3 +46,4 @@ T__27=27 T__28=28 T__29=29 T__30=30 +T__31=31 diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputationLexer.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputationLexer.java index f541841eaf249e78e8ef3ec3d06da3ca93fc993a..8716ca67d14e995bbcc6166670c65e36d188efe5 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputationLexer.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputationLexer.java @@ -25,6 +25,7 @@ public class InternalComputationLexer extends Lexer { public static final int T__14=14; public static final int EOF=-1; public static final int T__30=30; + public static final int T__31=31; public static final int RULE_ID=4; public static final int RULE_WS=9; public static final int RULE_ANY_OTHER=10; @@ -244,10 +245,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__20; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:20:7: ( 'block' ) - // InternalComputation.g:20:9: 'block' + // InternalComputation.g:20:7: ( 'group' ) + // InternalComputation.g:20:9: 'group' { - match("block"); + match("group"); } @@ -265,11 +266,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__21; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:21:7: ( 'ADD' ) - // InternalComputation.g:21:9: 'ADD' + // InternalComputation.g:21:7: ( ',' ) + // InternalComputation.g:21:9: ',' { - match("ADD"); - + match(','); } @@ -286,10 +286,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__22; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:22:7: ( 'MUL' ) - // InternalComputation.g:22:9: 'MUL' + // InternalComputation.g:22:7: ( 'block' ) + // InternalComputation.g:22:9: 'block' { - match("MUL"); + match("block"); } @@ -307,10 +307,11 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__23; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:23:7: ( ':' ) - // InternalComputation.g:23:9: ':' + // InternalComputation.g:23:7: ( 'ADD' ) + // InternalComputation.g:23:9: 'ADD' { - match(':'); + match("ADD"); + } @@ -327,10 +328,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__24; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:24:7: ( 'op' ) - // InternalComputation.g:24:9: 'op' + // InternalComputation.g:24:7: ( 'MUL' ) + // InternalComputation.g:24:9: 'MUL' { - match("op"); + match("MUL"); } @@ -348,10 +349,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__25; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:25:7: ( 'x' ) - // InternalComputation.g:25:9: 'x' + // InternalComputation.g:25:7: ( ':' ) + // InternalComputation.g:25:9: ':' { - match('x'); + match(':'); } @@ -368,10 +369,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__26; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:26:7: ( 'max' ) - // InternalComputation.g:26:9: 'max' + // InternalComputation.g:26:7: ( 'op' ) + // InternalComputation.g:26:9: 'op' { - match("max"); + match("op"); } @@ -389,10 +390,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__27; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:27:7: ( '(' ) - // InternalComputation.g:27:9: '(' + // InternalComputation.g:27:7: ( 'x' ) + // InternalComputation.g:27:9: 'x' { - match('('); + match('x'); } @@ -409,10 +410,11 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__28; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:28:7: ( ',' ) - // InternalComputation.g:28:9: ',' + // InternalComputation.g:28:7: ( 'max' ) + // InternalComputation.g:28:9: 'max' { - match(','); + match("max"); + } @@ -429,10 +431,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__29; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:29:7: ( ')' ) - // InternalComputation.g:29:9: ')' + // InternalComputation.g:29:7: ( '(' ) + // InternalComputation.g:29:9: '(' { - match(')'); + match('('); } @@ -449,10 +451,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = T__30; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:30:7: ( '+' ) - // InternalComputation.g:30:9: '+' + // InternalComputation.g:30:7: ( ')' ) + // InternalComputation.g:30:9: ')' { - match('+'); + match(')'); } @@ -464,15 +466,35 @@ public class InternalComputationLexer extends Lexer { } // $ANTLR end "T__30" + // $ANTLR start "T__31" + public final void mT__31() throws RecognitionException { + try { + int _type = T__31; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalComputation.g:31:7: ( '+' ) + // InternalComputation.g:31:9: '+' + { + match('+'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__31" + // $ANTLR start "RULE_ID" public final void mRULE_ID() throws RecognitionException { try { int _type = RULE_ID; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:994:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) - // InternalComputation.g:994:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalComputation.g:1094:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) + // InternalComputation.g:1094:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* { - // InternalComputation.g:994:11: ( '^' )? + // InternalComputation.g:1094:11: ( '^' )? int alt1=2; int LA1_0 = input.LA(1); @@ -481,7 +503,7 @@ public class InternalComputationLexer extends Lexer { } switch (alt1) { case 1 : - // InternalComputation.g:994:11: '^' + // InternalComputation.g:1094:11: '^' { match('^'); @@ -499,7 +521,7 @@ public class InternalComputationLexer extends Lexer { recover(mse); throw mse;} - // InternalComputation.g:994:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalComputation.g:1094:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* loop2: do { int alt2=2; @@ -548,10 +570,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = RULE_INT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:996:10: ( ( '0' .. '9' )+ ) - // InternalComputation.g:996:12: ( '0' .. '9' )+ + // InternalComputation.g:1096:10: ( ( '0' .. '9' )+ ) + // InternalComputation.g:1096:12: ( '0' .. '9' )+ { - // InternalComputation.g:996:12: ( '0' .. '9' )+ + // InternalComputation.g:1096:12: ( '0' .. '9' )+ int cnt3=0; loop3: do { @@ -565,7 +587,7 @@ public class InternalComputationLexer extends Lexer { switch (alt3) { case 1 : - // InternalComputation.g:996:13: '0' .. '9' + // InternalComputation.g:1096:13: '0' .. '9' { matchRange('0','9'); @@ -597,10 +619,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = RULE_STRING; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:998:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) - // InternalComputation.g:998:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) + // InternalComputation.g:1098:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) + // InternalComputation.g:1098:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) { - // InternalComputation.g:998:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) + // InternalComputation.g:1098:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) int alt6=2; int LA6_0 = input.LA(1); @@ -618,10 +640,10 @@ public class InternalComputationLexer extends Lexer { } switch (alt6) { case 1 : - // InternalComputation.g:998:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' + // InternalComputation.g:1098:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' { match('\"'); - // InternalComputation.g:998:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* + // InternalComputation.g:1098:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* loop4: do { int alt4=3; @@ -637,7 +659,7 @@ public class InternalComputationLexer extends Lexer { switch (alt4) { case 1 : - // InternalComputation.g:998:21: '\\\\' . + // InternalComputation.g:1098:21: '\\\\' . { match('\\'); matchAny(); @@ -645,7 +667,7 @@ public class InternalComputationLexer extends Lexer { } break; case 2 : - // InternalComputation.g:998:28: ~ ( ( '\\\\' | '\"' ) ) + // InternalComputation.g:1098:28: ~ ( ( '\\\\' | '\"' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -670,10 +692,10 @@ public class InternalComputationLexer extends Lexer { } break; case 2 : - // InternalComputation.g:998:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' + // InternalComputation.g:1098:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' { match('\''); - // InternalComputation.g:998:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* + // InternalComputation.g:1098:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* loop5: do { int alt5=3; @@ -689,7 +711,7 @@ public class InternalComputationLexer extends Lexer { switch (alt5) { case 1 : - // InternalComputation.g:998:54: '\\\\' . + // InternalComputation.g:1098:54: '\\\\' . { match('\\'); matchAny(); @@ -697,7 +719,7 @@ public class InternalComputationLexer extends Lexer { } break; case 2 : - // InternalComputation.g:998:61: ~ ( ( '\\\\' | '\\'' ) ) + // InternalComputation.g:1098:61: ~ ( ( '\\\\' | '\\'' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -740,12 +762,12 @@ public class InternalComputationLexer extends Lexer { try { int _type = RULE_ML_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:1000:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) - // InternalComputation.g:1000:19: '/*' ( options {greedy=false; } : . )* '*/' + // InternalComputation.g:1100:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) + // InternalComputation.g:1100:19: '/*' ( options {greedy=false; } : . )* '*/' { match("/*"); - // InternalComputation.g:1000:24: ( options {greedy=false; } : . )* + // InternalComputation.g:1100:24: ( options {greedy=false; } : . )* loop7: do { int alt7=2; @@ -770,7 +792,7 @@ public class InternalComputationLexer extends Lexer { switch (alt7) { case 1 : - // InternalComputation.g:1000:52: . + // InternalComputation.g:1100:52: . { matchAny(); @@ -800,12 +822,12 @@ public class InternalComputationLexer extends Lexer { try { int _type = RULE_SL_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:1002:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) - // InternalComputation.g:1002:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? + // InternalComputation.g:1102:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) + // InternalComputation.g:1102:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? { match("//"); - // InternalComputation.g:1002:24: (~ ( ( '\\n' | '\\r' ) ) )* + // InternalComputation.g:1102:24: (~ ( ( '\\n' | '\\r' ) ) )* loop8: do { int alt8=2; @@ -818,7 +840,7 @@ public class InternalComputationLexer extends Lexer { switch (alt8) { case 1 : - // InternalComputation.g:1002:24: ~ ( ( '\\n' | '\\r' ) ) + // InternalComputation.g:1102:24: ~ ( ( '\\n' | '\\r' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -838,7 +860,7 @@ public class InternalComputationLexer extends Lexer { } } while (true); - // InternalComputation.g:1002:40: ( ( '\\r' )? '\\n' )? + // InternalComputation.g:1102:40: ( ( '\\r' )? '\\n' )? int alt10=2; int LA10_0 = input.LA(1); @@ -847,9 +869,9 @@ public class InternalComputationLexer extends Lexer { } switch (alt10) { case 1 : - // InternalComputation.g:1002:41: ( '\\r' )? '\\n' + // InternalComputation.g:1102:41: ( '\\r' )? '\\n' { - // InternalComputation.g:1002:41: ( '\\r' )? + // InternalComputation.g:1102:41: ( '\\r' )? int alt9=2; int LA9_0 = input.LA(1); @@ -858,7 +880,7 @@ public class InternalComputationLexer extends Lexer { } switch (alt9) { case 1 : - // InternalComputation.g:1002:41: '\\r' + // InternalComputation.g:1102:41: '\\r' { match('\r'); @@ -890,10 +912,10 @@ public class InternalComputationLexer extends Lexer { try { int _type = RULE_WS; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:1004:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) - // InternalComputation.g:1004:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + // InternalComputation.g:1104:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) + // InternalComputation.g:1104:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ { - // InternalComputation.g:1004:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + // InternalComputation.g:1104:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ int cnt11=0; loop11: do { @@ -947,8 +969,8 @@ public class InternalComputationLexer extends Lexer { try { int _type = RULE_ANY_OTHER; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalComputation.g:1006:16: ( . ) - // InternalComputation.g:1006:18: . + // InternalComputation.g:1106:16: ( . ) + // InternalComputation.g:1106:18: . { matchAny(); @@ -963,8 +985,8 @@ public class InternalComputationLexer extends Lexer { // $ANTLR end "RULE_ANY_OTHER" public void mTokens() throws RecognitionException { - // InternalComputation.g:1:8: ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER ) - int alt12=27; + // InternalComputation.g:1:8: ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER ) + int alt12=28; alt12 = dfa12.predict(input); switch (alt12) { case 1 : @@ -1108,49 +1130,56 @@ public class InternalComputationLexer extends Lexer { } break; case 21 : - // InternalComputation.g:1:130: RULE_ID + // InternalComputation.g:1:130: T__31 { - mRULE_ID(); + mT__31(); } break; case 22 : - // InternalComputation.g:1:138: RULE_INT + // InternalComputation.g:1:136: RULE_ID { - mRULE_INT(); + mRULE_ID(); } break; case 23 : - // InternalComputation.g:1:147: RULE_STRING + // InternalComputation.g:1:144: RULE_INT { - mRULE_STRING(); + mRULE_INT(); } break; case 24 : - // InternalComputation.g:1:159: RULE_ML_COMMENT + // InternalComputation.g:1:153: RULE_STRING { - mRULE_ML_COMMENT(); + mRULE_STRING(); } break; case 25 : - // InternalComputation.g:1:175: RULE_SL_COMMENT + // InternalComputation.g:1:165: RULE_ML_COMMENT { - mRULE_SL_COMMENT(); + mRULE_ML_COMMENT(); } break; case 26 : - // InternalComputation.g:1:191: RULE_WS + // InternalComputation.g:1:181: RULE_SL_COMMENT { - mRULE_WS(); + mRULE_SL_COMMENT(); } break; case 27 : - // InternalComputation.g:1:199: RULE_ANY_OTHER + // InternalComputation.g:1:197: RULE_WS + { + mRULE_WS(); + + } + break; + case 28 : + // InternalComputation.g:1:205: RULE_ANY_OTHER { mRULE_ANY_OTHER(); @@ -1164,64 +1193,66 @@ public class InternalComputationLexer extends Lexer { protected DFA12 dfa12 = new DFA12(this); static final String DFA12_eotS = - "\1\uffff\1\35\2\uffff\1\35\1\uffff\2\35\1\uffff\3\35\1\uffff\1\52\1\35\4\uffff\1\32\2\uffff\3\32\2\uffff\2\35\3\uffff\1\35\1\uffff\2\35\1\72\1\uffff\3\35\2\uffff\1\35\11\uffff\5\35\1\uffff\1\35\1\105\1\106\1\107\6\35\3\uffff\1\116\4\35\1\123\1\uffff\1\35\1\125\2\35\1\uffff\1\35\1\uffff\6\35\1\137\2\35\1\uffff\1\35\1\143\1\35\1\uffff\3\35\1\150\1\uffff"; + "\1\uffff\1\36\2\uffff\1\36\1\uffff\2\36\1\uffff\1\36\1\uffff\3\36\1\uffff\1\55\1\36\3\uffff\1\33\2\uffff\3\33\2\uffff\2\36\3\uffff\1\36\1\uffff\2\36\1\74\1\uffff\1\36\1\uffff\3\36\2\uffff\1\36\10\uffff\5\36\1\uffff\2\36\1\111\1\112\1\113\7\36\3\uffff\1\123\4\36\1\130\1\131\1\uffff\1\36\1\133\2\36\2\uffff\1\36\1\uffff\6\36\1\145\2\36\1\uffff\1\36\1\151\1\36\1\uffff\3\36\1\156\1\uffff"; static final String DFA12_eofS = - "\151\uffff"; + "\157\uffff"; static final String DFA12_minS = - "\1\0\1\141\2\uffff\1\141\1\uffff\1\162\1\160\1\uffff\1\154\1\104\1\125\1\uffff\1\60\1\141\4\uffff\1\101\2\uffff\2\0\1\52\2\uffff\1\162\1\157\3\uffff\1\162\1\uffff\1\145\1\164\1\60\1\uffff\1\157\1\104\1\114\2\uffff\1\170\11\uffff\1\141\1\142\1\147\1\161\1\160\1\uffff\1\143\3\60\1\155\1\154\1\145\2\165\1\153\3\uffff\1\60\1\145\1\164\1\145\1\164\1\60\1\uffff\1\155\1\60\1\156\1\163\1\uffff\1\123\1\uffff\1\143\1\120\1\151\1\171\1\145\1\172\1\60\1\162\1\145\1\uffff\1\103\1\60\1\171\1\uffff\1\143\1\154\1\145\1\60\1\uffff"; + "\1\0\1\141\2\uffff\1\141\1\uffff\1\162\1\160\1\uffff\1\162\1\uffff\1\154\1\104\1\125\1\uffff\1\60\1\141\3\uffff\1\101\2\uffff\2\0\1\52\2\uffff\1\162\1\157\3\uffff\1\162\1\uffff\1\145\1\164\1\60\1\uffff\1\157\1\uffff\1\157\1\104\1\114\2\uffff\1\170\10\uffff\1\141\1\142\1\147\1\161\1\160\1\uffff\1\165\1\143\3\60\1\155\1\154\1\145\2\165\1\160\1\153\3\uffff\1\60\1\145\1\164\1\145\1\164\2\60\1\uffff\1\155\1\60\1\156\1\163\2\uffff\1\123\1\uffff\1\143\1\120\1\151\1\171\1\145\1\172\1\60\1\162\1\145\1\uffff\1\103\1\60\1\171\1\uffff\1\143\1\154\1\145\1\60\1\uffff"; static final String DFA12_maxS = - "\1\uffff\1\162\2\uffff\1\141\1\uffff\1\162\1\165\1\uffff\1\154\1\104\1\125\1\uffff\1\172\1\141\4\uffff\1\172\2\uffff\2\uffff\1\57\2\uffff\1\162\1\157\3\uffff\1\162\1\uffff\1\145\1\164\1\172\1\uffff\1\157\1\104\1\114\2\uffff\1\170\11\uffff\1\141\1\142\1\147\1\161\1\160\1\uffff\1\143\3\172\1\155\1\154\1\145\2\165\1\153\3\uffff\1\172\1\145\1\164\1\145\1\164\1\172\1\uffff\1\155\1\172\1\156\1\163\1\uffff\1\123\1\uffff\1\143\1\120\1\151\1\171\1\145\2\172\1\162\1\145\1\uffff\1\103\1\172\1\171\1\uffff\1\143\1\154\1\145\1\172\1\uffff"; + "\1\uffff\1\162\2\uffff\1\141\1\uffff\1\162\1\165\1\uffff\1\162\1\uffff\1\154\1\104\1\125\1\uffff\1\172\1\141\3\uffff\1\172\2\uffff\2\uffff\1\57\2\uffff\1\162\1\157\3\uffff\1\162\1\uffff\1\145\1\164\1\172\1\uffff\1\157\1\uffff\1\157\1\104\1\114\2\uffff\1\170\10\uffff\1\141\1\142\1\147\1\161\1\160\1\uffff\1\165\1\143\3\172\1\155\1\154\1\145\2\165\1\160\1\153\3\uffff\1\172\1\145\1\164\1\145\1\164\2\172\1\uffff\1\155\1\172\1\156\1\163\2\uffff\1\123\1\uffff\1\143\1\120\1\151\1\171\1\145\2\172\1\162\1\145\1\uffff\1\103\1\172\1\171\1\uffff\1\143\1\154\1\145\1\172\1\uffff"; static final String DFA12_acceptS = - "\2\uffff\1\2\1\3\1\uffff\1\5\2\uffff\1\11\3\uffff\1\15\2\uffff\1\21\1\22\1\23\1\24\1\uffff\1\25\1\26\3\uffff\1\32\1\33\2\uffff\1\25\1\2\1\3\1\uffff\1\5\3\uffff\1\11\3\uffff\1\15\1\17\1\uffff\1\21\1\22\1\23\1\24\1\26\1\27\1\30\1\31\1\32\5\uffff\1\16\12\uffff\1\13\1\14\1\20\6\uffff\1\1\4\uffff\1\12\1\uffff\1\4\11\uffff\1\6\3\uffff\1\10\4\uffff\1\7"; + "\2\uffff\1\2\1\3\1\uffff\1\5\2\uffff\1\11\1\uffff\1\13\3\uffff\1\17\2\uffff\1\23\1\24\1\25\1\uffff\1\26\1\27\3\uffff\1\33\1\34\2\uffff\1\26\1\2\1\3\1\uffff\1\5\3\uffff\1\11\1\uffff\1\13\3\uffff\1\17\1\21\1\uffff\1\23\1\24\1\25\1\27\1\30\1\31\1\32\1\33\5\uffff\1\20\14\uffff\1\15\1\16\1\22\7\uffff\1\1\4\uffff\1\12\1\14\1\uffff\1\4\11\uffff\1\6\3\uffff\1\10\4\uffff\1\7"; static final String DFA12_specialS = - "\1\0\25\uffff\1\2\1\1\121\uffff}>"; + "\1\2\26\uffff\1\0\1\1\126\uffff}>"; static final String[] DFA12_transitionS = { - "\11\32\2\31\2\32\1\31\22\32\1\31\1\32\1\26\4\32\1\27\1\17\1\21\1\32\1\22\1\20\2\32\1\30\12\25\1\14\1\3\1\32\1\2\3\32\1\12\13\24\1\13\15\24\3\32\1\23\1\24\1\32\1\24\1\11\3\24\1\6\6\24\1\16\1\24\1\7\1\1\3\24\1\4\3\24\1\15\2\24\1\5\1\32\1\10\uff82\32", - "\1\33\20\uffff\1\34", + "\11\33\2\32\2\33\1\32\22\33\1\32\1\33\1\27\4\33\1\30\1\21\1\22\1\33\1\23\1\12\2\33\1\31\12\26\1\16\1\3\1\33\1\2\3\33\1\14\13\25\1\15\15\25\3\33\1\24\1\25\1\33\1\25\1\13\3\25\1\6\1\11\5\25\1\20\1\25\1\7\1\1\3\25\1\4\3\25\1\17\2\25\1\5\1\33\1\10\uff82\33", + "\1\34\20\uffff\1\35", "", "", - "\1\40", + "\1\41", "", - "\1\42", - "\1\44\4\uffff\1\43", + "\1\43", + "\1\45\4\uffff\1\44", "", - "\1\46", "\1\47", - "\1\50", "", - "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", + "\1\51", + "\1\52", "\1\53", "", + "\12\36\7\uffff\32\36\4\uffff\1\36\1\uffff\32\36", + "\1\56", "", "", "", - "\32\35\4\uffff\1\35\1\uffff\32\35", - "", + "\32\36\4\uffff\1\36\1\uffff\32\36", "", - "\0\61", - "\0\61", - "\1\62\4\uffff\1\63", "", + "\0\63", + "\0\63", + "\1\64\4\uffff\1\65", "", - "\1\65", - "\1\66", "", + "\1\67", + "\1\70", "", "", - "\1\67", "", - "\1\70", "\1\71", - "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", "", + "\1\72", "\1\73", - "\1\74", - "\1\75", + "\12\36\7\uffff\32\36\4\uffff\1\36\1\uffff\32\36", "", + "\1\75", "", "\1\76", + "\1\77", + "\1\100", "", "", + "\1\101", + "", "", "", "", @@ -1229,57 +1260,61 @@ public class InternalComputationLexer extends Lexer { "", "", "", - "\1\77", - "\1\100", - "\1\101", "\1\102", "\1\103", - "", "\1\104", - "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", - "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", - "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", + "\1\105", + "\1\106", + "", + "\1\107", "\1\110", - "\1\111", - "\1\112", - "\1\113", + "\12\36\7\uffff\32\36\4\uffff\1\36\1\uffff\32\36", + "\12\36\7\uffff\32\36\4\uffff\1\36\1\uffff\32\36", + "\12\36\7\uffff\32\36\4\uffff\1\36\1\uffff\32\36", "\1\114", "\1\115", - "", - "", - "", - "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", + "\1\116", "\1\117", "\1\120", "\1\121", "\1\122", - "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", "", + "", + "", + "\12\36\7\uffff\32\36\4\uffff\1\36\1\uffff\32\36", "\1\124", - "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", + "\1\125", "\1\126", "\1\127", + "\12\36\7\uffff\32\36\4\uffff\1\36\1\uffff\32\36", + "\12\36\7\uffff\32\36\4\uffff\1\36\1\uffff\32\36", "", - "\1\130", - "", - "\1\131", "\1\132", - "\1\133", + "\12\36\7\uffff\32\36\4\uffff\1\36\1\uffff\32\36", "\1\134", "\1\135", + "", + "", "\1\136", - "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", + "", + "\1\137", "\1\140", "\1\141", - "", "\1\142", - "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", + "\1\143", "\1\144", - "", - "\1\145", + "\12\36\7\uffff\32\36\4\uffff\1\36\1\uffff\32\36", "\1\146", "\1\147", - "\12\35\7\uffff\32\35\4\uffff\1\35\1\uffff\32\35", + "", + "\1\150", + "\12\36\7\uffff\32\36\4\uffff\1\36\1\uffff\32\36", + "\1\152", + "", + "\1\153", + "\1\154", + "\1\155", + "\12\36\7\uffff\32\36\4\uffff\1\36\1\uffff\32\36", "" }; @@ -1313,13 +1348,33 @@ public class InternalComputationLexer extends Lexer { this.transition = DFA12_transition; } public String getDescription() { - return "1:1: Tokens : ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );"; + return "1:1: Tokens : ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );"; } public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { IntStream input = _input; int _s = s; switch ( s ) { case 0 : + int LA12_23 = input.LA(1); + + s = -1; + if ( ((LA12_23>='\u0000' && LA12_23<='\uFFFF')) ) {s = 51;} + + else s = 27; + + if ( s>=0 ) return s; + break; + case 1 : + int LA12_24 = input.LA(1); + + s = -1; + if ( ((LA12_24>='\u0000' && LA12_24<='\uFFFF')) ) {s = 51;} + + else s = 27; + + if ( s>=0 ) return s; + break; + case 2 : int LA12_0 = input.LA(1); s = -1; @@ -1339,61 +1394,43 @@ public class InternalComputationLexer extends Lexer { else if ( (LA12_0=='}') ) {s = 8;} - else if ( (LA12_0=='b') ) {s = 9;} + else if ( (LA12_0=='g') ) {s = 9;} - else if ( (LA12_0=='A') ) {s = 10;} + else if ( (LA12_0==',') ) {s = 10;} - else if ( (LA12_0=='M') ) {s = 11;} + else if ( (LA12_0=='b') ) {s = 11;} - else if ( (LA12_0==':') ) {s = 12;} + else if ( (LA12_0=='A') ) {s = 12;} - else if ( (LA12_0=='x') ) {s = 13;} + else if ( (LA12_0=='M') ) {s = 13;} - else if ( (LA12_0=='m') ) {s = 14;} + else if ( (LA12_0==':') ) {s = 14;} - else if ( (LA12_0=='(') ) {s = 15;} + else if ( (LA12_0=='x') ) {s = 15;} - else if ( (LA12_0==',') ) {s = 16;} + else if ( (LA12_0=='m') ) {s = 16;} - else if ( (LA12_0==')') ) {s = 17;} + else if ( (LA12_0=='(') ) {s = 17;} - else if ( (LA12_0=='+') ) {s = 18;} + else if ( (LA12_0==')') ) {s = 18;} - else if ( (LA12_0=='^') ) {s = 19;} + else if ( (LA12_0=='+') ) {s = 19;} - else if ( ((LA12_0>='B' && LA12_0<='L')||(LA12_0>='N' && LA12_0<='Z')||LA12_0=='_'||LA12_0=='a'||(LA12_0>='c' && LA12_0<='e')||(LA12_0>='g' && LA12_0<='l')||LA12_0=='n'||(LA12_0>='q' && LA12_0<='s')||(LA12_0>='u' && LA12_0<='w')||(LA12_0>='y' && LA12_0<='z')) ) {s = 20;} + else if ( (LA12_0=='^') ) {s = 20;} - else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 21;} + else if ( ((LA12_0>='B' && LA12_0<='L')||(LA12_0>='N' && LA12_0<='Z')||LA12_0=='_'||LA12_0=='a'||(LA12_0>='c' && LA12_0<='e')||(LA12_0>='h' && LA12_0<='l')||LA12_0=='n'||(LA12_0>='q' && LA12_0<='s')||(LA12_0>='u' && LA12_0<='w')||(LA12_0>='y' && LA12_0<='z')) ) {s = 21;} - else if ( (LA12_0=='\"') ) {s = 22;} + else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 22;} - else if ( (LA12_0=='\'') ) {s = 23;} + else if ( (LA12_0=='\"') ) {s = 23;} - else if ( (LA12_0=='/') ) {s = 24;} + else if ( (LA12_0=='\'') ) {s = 24;} - else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 25;} + else if ( (LA12_0=='/') ) {s = 25;} - else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||LA12_0=='*'||(LA12_0>='-' && LA12_0<='.')||LA12_0=='<'||(LA12_0>='>' && LA12_0<='@')||(LA12_0>='[' && LA12_0<=']')||LA12_0=='`'||LA12_0=='|'||(LA12_0>='~' && LA12_0<='\uFFFF')) ) {s = 26;} - - if ( s>=0 ) return s; - break; - case 1 : - int LA12_23 = input.LA(1); - - s = -1; - if ( ((LA12_23>='\u0000' && LA12_23<='\uFFFF')) ) {s = 49;} - - else s = 26; - - if ( s>=0 ) return s; - break; - case 2 : - int LA12_22 = input.LA(1); - - s = -1; - if ( ((LA12_22>='\u0000' && LA12_22<='\uFFFF')) ) {s = 49;} + else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 26;} - else s = 26; + else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||LA12_0=='*'||(LA12_0>='-' && LA12_0<='.')||LA12_0=='<'||(LA12_0>='>' && LA12_0<='@')||(LA12_0>='[' && LA12_0<=']')||LA12_0=='`'||LA12_0=='|'||(LA12_0>='~' && LA12_0<='\uFFFF')) ) {s = 27;} if ( s>=0 ) return s; break; diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputationParser.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputationParser.java index f93d483cbdd5a90dcc0528477f4c098973ecfbb2..de52661829ea2c00ee9ea143b206e2a439a59ec6 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputationParser.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/parser/antlr/internal/InternalComputationParser.java @@ -21,7 +21,7 @@ import java.util.ArrayList; @SuppressWarnings("all") public class InternalComputationParser extends AbstractInternalAntlrParser { public static final String[] tokenNames = new String[] { - "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_INT", "RULE_STRING", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'param'", "'='", "';'", "'target'", "'{'", "'frequency'", "'outputsPerCycle'", "'problemSize'", "'}'", "'block'", "'ADD'", "'MUL'", "':'", "'op'", "'x'", "'max'", "'('", "','", "')'", "'+'" + "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_INT", "RULE_STRING", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'param'", "'='", "';'", "'target'", "'{'", "'frequency'", "'outputsPerCycle'", "'problemSize'", "'}'", "'group'", "','", "'block'", "'ADD'", "'MUL'", "':'", "'op'", "'x'", "'max'", "'('", "')'", "'+'" }; public static final int RULE_STRING=6; public static final int RULE_SL_COMMENT=8; @@ -36,6 +36,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { public static final int T__14=14; public static final int EOF=-1; public static final int T__30=30; + public static final int T__31=31; public static final int RULE_ID=4; public static final int RULE_WS=9; public static final int RULE_ANY_OTHER=10; @@ -128,7 +129,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleComputationModel" - // InternalComputation.g:71:1: ruleComputationModel returns [EObject current=null] : ( ( (lv_parameters_0_0= ruleParameter ) )* ( (lv_targetDesign_1_0= ruleHWTargetDesign ) ) ( (lv_blocks_2_0= ruleComputationBlock ) )+ ) ; + // InternalComputation.g:71:1: ruleComputationModel returns [EObject current=null] : ( ( (lv_parameters_0_0= ruleParameter ) )* ( (lv_targetDesign_1_0= ruleHWTargetDesign ) ) ( (lv_blockGroups_2_0= ruleBlockGroup ) )* ( (lv_blocks_3_0= ruleComputationBlock ) )+ ) ; public final EObject ruleComputationModel() throws RecognitionException { EObject current = null; @@ -136,18 +137,20 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { EObject lv_targetDesign_1_0 = null; - EObject lv_blocks_2_0 = null; + EObject lv_blockGroups_2_0 = null; + + EObject lv_blocks_3_0 = null; enterRule(); try { - // InternalComputation.g:77:2: ( ( ( (lv_parameters_0_0= ruleParameter ) )* ( (lv_targetDesign_1_0= ruleHWTargetDesign ) ) ( (lv_blocks_2_0= ruleComputationBlock ) )+ ) ) - // InternalComputation.g:78:2: ( ( (lv_parameters_0_0= ruleParameter ) )* ( (lv_targetDesign_1_0= ruleHWTargetDesign ) ) ( (lv_blocks_2_0= ruleComputationBlock ) )+ ) + // InternalComputation.g:77:2: ( ( ( (lv_parameters_0_0= ruleParameter ) )* ( (lv_targetDesign_1_0= ruleHWTargetDesign ) ) ( (lv_blockGroups_2_0= ruleBlockGroup ) )* ( (lv_blocks_3_0= ruleComputationBlock ) )+ ) ) + // InternalComputation.g:78:2: ( ( (lv_parameters_0_0= ruleParameter ) )* ( (lv_targetDesign_1_0= ruleHWTargetDesign ) ) ( (lv_blockGroups_2_0= ruleBlockGroup ) )* ( (lv_blocks_3_0= ruleComputationBlock ) )+ ) { - // InternalComputation.g:78:2: ( ( (lv_parameters_0_0= ruleParameter ) )* ( (lv_targetDesign_1_0= ruleHWTargetDesign ) ) ( (lv_blocks_2_0= ruleComputationBlock ) )+ ) - // InternalComputation.g:79:3: ( (lv_parameters_0_0= ruleParameter ) )* ( (lv_targetDesign_1_0= ruleHWTargetDesign ) ) ( (lv_blocks_2_0= ruleComputationBlock ) )+ + // InternalComputation.g:78:2: ( ( (lv_parameters_0_0= ruleParameter ) )* ( (lv_targetDesign_1_0= ruleHWTargetDesign ) ) ( (lv_blockGroups_2_0= ruleBlockGroup ) )* ( (lv_blocks_3_0= ruleComputationBlock ) )+ ) + // InternalComputation.g:79:3: ( (lv_parameters_0_0= ruleParameter ) )* ( (lv_targetDesign_1_0= ruleHWTargetDesign ) ) ( (lv_blockGroups_2_0= ruleBlockGroup ) )* ( (lv_blocks_3_0= ruleComputationBlock ) )+ { // InternalComputation.g:79:3: ( (lv_parameters_0_0= ruleParameter ) )* loop1: @@ -229,8 +232,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } - // InternalComputation.g:117:3: ( (lv_blocks_2_0= ruleComputationBlock ) )+ - int cnt2=0; + // InternalComputation.g:117:3: ( (lv_blockGroups_2_0= ruleBlockGroup ) )* loop2: do { int alt2=2; @@ -243,16 +245,66 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { switch (alt2) { case 1 : - // InternalComputation.g:118:4: (lv_blocks_2_0= ruleComputationBlock ) + // InternalComputation.g:118:4: (lv_blockGroups_2_0= ruleBlockGroup ) + { + // InternalComputation.g:118:4: (lv_blockGroups_2_0= ruleBlockGroup ) + // InternalComputation.g:119:5: lv_blockGroups_2_0= ruleBlockGroup + { + + newCompositeNode(grammarAccess.getComputationModelAccess().getBlockGroupsBlockGroupParserRuleCall_2_0()); + + pushFollow(FOLLOW_4); + lv_blockGroups_2_0=ruleBlockGroup(); + + state._fsp--; + + + if (current==null) { + current = createModelElementForParent(grammarAccess.getComputationModelRule()); + } + add( + current, + "blockGroups", + lv_blockGroups_2_0, + "fr.irisa.cairn.gecos.typeexploration.Computation.BlockGroup"); + afterParserOrEnumRuleCall(); + + + } + + + } + break; + + default : + break loop2; + } + } while (true); + + // InternalComputation.g:136:3: ( (lv_blocks_3_0= ruleComputationBlock ) )+ + int cnt3=0; + loop3: + do { + int alt3=2; + int LA3_0 = input.LA(1); + + if ( (LA3_0==22) ) { + alt3=1; + } + + + switch (alt3) { + case 1 : + // InternalComputation.g:137:4: (lv_blocks_3_0= ruleComputationBlock ) { - // InternalComputation.g:118:4: (lv_blocks_2_0= ruleComputationBlock ) - // InternalComputation.g:119:5: lv_blocks_2_0= ruleComputationBlock + // InternalComputation.g:137:4: (lv_blocks_3_0= ruleComputationBlock ) + // InternalComputation.g:138:5: lv_blocks_3_0= ruleComputationBlock { - newCompositeNode(grammarAccess.getComputationModelAccess().getBlocksComputationBlockParserRuleCall_2_0()); + newCompositeNode(grammarAccess.getComputationModelAccess().getBlocksComputationBlockParserRuleCall_3_0()); pushFollow(FOLLOW_5); - lv_blocks_2_0=ruleComputationBlock(); + lv_blocks_3_0=ruleComputationBlock(); state._fsp--; @@ -263,7 +315,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { add( current, "blocks", - lv_blocks_2_0, + lv_blocks_3_0, "fr.irisa.cairn.gecos.typeexploration.Computation.ComputationBlock"); afterParserOrEnumRuleCall(); @@ -275,12 +327,12 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { break; default : - if ( cnt2 >= 1 ) break loop2; + if ( cnt3 >= 1 ) break loop3; EarlyExitException eee = - new EarlyExitException(2, input); + new EarlyExitException(3, input); throw eee; } - cnt2++; + cnt3++; } while (true); @@ -306,7 +358,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "entryRuleParameter" - // InternalComputation.g:140:1: entryRuleParameter returns [EObject current=null] : iv_ruleParameter= ruleParameter EOF ; + // InternalComputation.g:159:1: entryRuleParameter returns [EObject current=null] : iv_ruleParameter= ruleParameter EOF ; public final EObject entryRuleParameter() throws RecognitionException { EObject current = null; @@ -314,8 +366,8 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { try { - // InternalComputation.g:140:50: (iv_ruleParameter= ruleParameter EOF ) - // InternalComputation.g:141:2: iv_ruleParameter= ruleParameter EOF + // InternalComputation.g:159:50: (iv_ruleParameter= ruleParameter EOF ) + // InternalComputation.g:160:2: iv_ruleParameter= ruleParameter EOF { newCompositeNode(grammarAccess.getParameterRule()); pushFollow(FOLLOW_1); @@ -342,7 +394,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleParameter" - // InternalComputation.g:147:1: ruleParameter returns [EObject current=null] : (otherlv_0= 'param' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_value_3_0= RULE_INT ) ) otherlv_4= ';' ) ; + // InternalComputation.g:166:1: ruleParameter returns [EObject current=null] : (otherlv_0= 'param' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_value_3_0= RULE_INT ) ) otherlv_4= ';' ) ; public final EObject ruleParameter() throws RecognitionException { EObject current = null; @@ -356,21 +408,21 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalComputation.g:153:2: ( (otherlv_0= 'param' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_value_3_0= RULE_INT ) ) otherlv_4= ';' ) ) - // InternalComputation.g:154:2: (otherlv_0= 'param' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_value_3_0= RULE_INT ) ) otherlv_4= ';' ) + // InternalComputation.g:172:2: ( (otherlv_0= 'param' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_value_3_0= RULE_INT ) ) otherlv_4= ';' ) ) + // InternalComputation.g:173:2: (otherlv_0= 'param' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_value_3_0= RULE_INT ) ) otherlv_4= ';' ) { - // InternalComputation.g:154:2: (otherlv_0= 'param' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_value_3_0= RULE_INT ) ) otherlv_4= ';' ) - // InternalComputation.g:155:3: otherlv_0= 'param' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_value_3_0= RULE_INT ) ) otherlv_4= ';' + // InternalComputation.g:173:2: (otherlv_0= 'param' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_value_3_0= RULE_INT ) ) otherlv_4= ';' ) + // InternalComputation.g:174:3: otherlv_0= 'param' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '=' ( (lv_value_3_0= RULE_INT ) ) otherlv_4= ';' { otherlv_0=(Token)match(input,11,FOLLOW_6); newLeafNode(otherlv_0, grammarAccess.getParameterAccess().getParamKeyword_0()); - // InternalComputation.g:159:3: ( (lv_name_1_0= RULE_ID ) ) - // InternalComputation.g:160:4: (lv_name_1_0= RULE_ID ) + // InternalComputation.g:178:3: ( (lv_name_1_0= RULE_ID ) ) + // InternalComputation.g:179:4: (lv_name_1_0= RULE_ID ) { - // InternalComputation.g:160:4: (lv_name_1_0= RULE_ID ) - // InternalComputation.g:161:5: lv_name_1_0= RULE_ID + // InternalComputation.g:179:4: (lv_name_1_0= RULE_ID ) + // InternalComputation.g:180:5: lv_name_1_0= RULE_ID { lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_7); @@ -396,11 +448,11 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { newLeafNode(otherlv_2, grammarAccess.getParameterAccess().getEqualsSignKeyword_2()); - // InternalComputation.g:181:3: ( (lv_value_3_0= RULE_INT ) ) - // InternalComputation.g:182:4: (lv_value_3_0= RULE_INT ) + // InternalComputation.g:200:3: ( (lv_value_3_0= RULE_INT ) ) + // InternalComputation.g:201:4: (lv_value_3_0= RULE_INT ) { - // InternalComputation.g:182:4: (lv_value_3_0= RULE_INT ) - // InternalComputation.g:183:5: lv_value_3_0= RULE_INT + // InternalComputation.g:201:4: (lv_value_3_0= RULE_INT ) + // InternalComputation.g:202:5: lv_value_3_0= RULE_INT { lv_value_3_0=(Token)match(input,RULE_INT,FOLLOW_9); @@ -449,7 +501,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "entryRuleHWTargetDesign" - // InternalComputation.g:207:1: entryRuleHWTargetDesign returns [EObject current=null] : iv_ruleHWTargetDesign= ruleHWTargetDesign EOF ; + // InternalComputation.g:226:1: entryRuleHWTargetDesign returns [EObject current=null] : iv_ruleHWTargetDesign= ruleHWTargetDesign EOF ; public final EObject entryRuleHWTargetDesign() throws RecognitionException { EObject current = null; @@ -457,8 +509,8 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { try { - // InternalComputation.g:207:55: (iv_ruleHWTargetDesign= ruleHWTargetDesign EOF ) - // InternalComputation.g:208:2: iv_ruleHWTargetDesign= ruleHWTargetDesign EOF + // InternalComputation.g:226:55: (iv_ruleHWTargetDesign= ruleHWTargetDesign EOF ) + // InternalComputation.g:227:2: iv_ruleHWTargetDesign= ruleHWTargetDesign EOF { newCompositeNode(grammarAccess.getHWTargetDesignRule()); pushFollow(FOLLOW_1); @@ -485,7 +537,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleHWTargetDesign" - // InternalComputation.g:214:1: ruleHWTargetDesign returns [EObject current=null] : (otherlv_0= 'target' otherlv_1= '{' otherlv_2= 'frequency' otherlv_3= '=' ( (lv_frequency_4_0= RULE_INT ) ) otherlv_5= 'outputsPerCycle' otherlv_6= '=' ( (lv_outputsPerCycle_7_0= RULE_INT ) ) otherlv_8= 'problemSize' otherlv_9= '=' ( (lv_problemSizeExpr_10_0= ruleSummationExpression ) ) otherlv_11= '}' ) ; + // InternalComputation.g:233:1: ruleHWTargetDesign returns [EObject current=null] : (otherlv_0= 'target' otherlv_1= '{' otherlv_2= 'frequency' otherlv_3= '=' ( (lv_frequency_4_0= RULE_INT ) ) otherlv_5= 'outputsPerCycle' otherlv_6= '=' ( (lv_outputsPerCycle_7_0= RULE_INT ) ) otherlv_8= 'problemSize' otherlv_9= '=' ( (lv_problemSizeExpr_10_0= ruleSummationExpression ) ) otherlv_11= '}' ) ; public final EObject ruleHWTargetDesign() throws RecognitionException { EObject current = null; @@ -507,11 +559,11 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalComputation.g:220:2: ( (otherlv_0= 'target' otherlv_1= '{' otherlv_2= 'frequency' otherlv_3= '=' ( (lv_frequency_4_0= RULE_INT ) ) otherlv_5= 'outputsPerCycle' otherlv_6= '=' ( (lv_outputsPerCycle_7_0= RULE_INT ) ) otherlv_8= 'problemSize' otherlv_9= '=' ( (lv_problemSizeExpr_10_0= ruleSummationExpression ) ) otherlv_11= '}' ) ) - // InternalComputation.g:221:2: (otherlv_0= 'target' otherlv_1= '{' otherlv_2= 'frequency' otherlv_3= '=' ( (lv_frequency_4_0= RULE_INT ) ) otherlv_5= 'outputsPerCycle' otherlv_6= '=' ( (lv_outputsPerCycle_7_0= RULE_INT ) ) otherlv_8= 'problemSize' otherlv_9= '=' ( (lv_problemSizeExpr_10_0= ruleSummationExpression ) ) otherlv_11= '}' ) + // InternalComputation.g:239:2: ( (otherlv_0= 'target' otherlv_1= '{' otherlv_2= 'frequency' otherlv_3= '=' ( (lv_frequency_4_0= RULE_INT ) ) otherlv_5= 'outputsPerCycle' otherlv_6= '=' ( (lv_outputsPerCycle_7_0= RULE_INT ) ) otherlv_8= 'problemSize' otherlv_9= '=' ( (lv_problemSizeExpr_10_0= ruleSummationExpression ) ) otherlv_11= '}' ) ) + // InternalComputation.g:240:2: (otherlv_0= 'target' otherlv_1= '{' otherlv_2= 'frequency' otherlv_3= '=' ( (lv_frequency_4_0= RULE_INT ) ) otherlv_5= 'outputsPerCycle' otherlv_6= '=' ( (lv_outputsPerCycle_7_0= RULE_INT ) ) otherlv_8= 'problemSize' otherlv_9= '=' ( (lv_problemSizeExpr_10_0= ruleSummationExpression ) ) otherlv_11= '}' ) { - // InternalComputation.g:221:2: (otherlv_0= 'target' otherlv_1= '{' otherlv_2= 'frequency' otherlv_3= '=' ( (lv_frequency_4_0= RULE_INT ) ) otherlv_5= 'outputsPerCycle' otherlv_6= '=' ( (lv_outputsPerCycle_7_0= RULE_INT ) ) otherlv_8= 'problemSize' otherlv_9= '=' ( (lv_problemSizeExpr_10_0= ruleSummationExpression ) ) otherlv_11= '}' ) - // InternalComputation.g:222:3: otherlv_0= 'target' otherlv_1= '{' otherlv_2= 'frequency' otherlv_3= '=' ( (lv_frequency_4_0= RULE_INT ) ) otherlv_5= 'outputsPerCycle' otherlv_6= '=' ( (lv_outputsPerCycle_7_0= RULE_INT ) ) otherlv_8= 'problemSize' otherlv_9= '=' ( (lv_problemSizeExpr_10_0= ruleSummationExpression ) ) otherlv_11= '}' + // InternalComputation.g:240:2: (otherlv_0= 'target' otherlv_1= '{' otherlv_2= 'frequency' otherlv_3= '=' ( (lv_frequency_4_0= RULE_INT ) ) otherlv_5= 'outputsPerCycle' otherlv_6= '=' ( (lv_outputsPerCycle_7_0= RULE_INT ) ) otherlv_8= 'problemSize' otherlv_9= '=' ( (lv_problemSizeExpr_10_0= ruleSummationExpression ) ) otherlv_11= '}' ) + // InternalComputation.g:241:3: otherlv_0= 'target' otherlv_1= '{' otherlv_2= 'frequency' otherlv_3= '=' ( (lv_frequency_4_0= RULE_INT ) ) otherlv_5= 'outputsPerCycle' otherlv_6= '=' ( (lv_outputsPerCycle_7_0= RULE_INT ) ) otherlv_8= 'problemSize' otherlv_9= '=' ( (lv_problemSizeExpr_10_0= ruleSummationExpression ) ) otherlv_11= '}' { otherlv_0=(Token)match(input,14,FOLLOW_10); @@ -529,11 +581,11 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { newLeafNode(otherlv_3, grammarAccess.getHWTargetDesignAccess().getEqualsSignKeyword_3()); - // InternalComputation.g:238:3: ( (lv_frequency_4_0= RULE_INT ) ) - // InternalComputation.g:239:4: (lv_frequency_4_0= RULE_INT ) + // InternalComputation.g:257:3: ( (lv_frequency_4_0= RULE_INT ) ) + // InternalComputation.g:258:4: (lv_frequency_4_0= RULE_INT ) { - // InternalComputation.g:239:4: (lv_frequency_4_0= RULE_INT ) - // InternalComputation.g:240:5: lv_frequency_4_0= RULE_INT + // InternalComputation.g:258:4: (lv_frequency_4_0= RULE_INT ) + // InternalComputation.g:259:5: lv_frequency_4_0= RULE_INT { lv_frequency_4_0=(Token)match(input,RULE_INT,FOLLOW_12); @@ -563,11 +615,11 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { newLeafNode(otherlv_6, grammarAccess.getHWTargetDesignAccess().getEqualsSignKeyword_6()); - // InternalComputation.g:264:3: ( (lv_outputsPerCycle_7_0= RULE_INT ) ) - // InternalComputation.g:265:4: (lv_outputsPerCycle_7_0= RULE_INT ) + // InternalComputation.g:283:3: ( (lv_outputsPerCycle_7_0= RULE_INT ) ) + // InternalComputation.g:284:4: (lv_outputsPerCycle_7_0= RULE_INT ) { - // InternalComputation.g:265:4: (lv_outputsPerCycle_7_0= RULE_INT ) - // InternalComputation.g:266:5: lv_outputsPerCycle_7_0= RULE_INT + // InternalComputation.g:284:4: (lv_outputsPerCycle_7_0= RULE_INT ) + // InternalComputation.g:285:5: lv_outputsPerCycle_7_0= RULE_INT { lv_outputsPerCycle_7_0=(Token)match(input,RULE_INT,FOLLOW_13); @@ -597,11 +649,11 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { newLeafNode(otherlv_9, grammarAccess.getHWTargetDesignAccess().getEqualsSignKeyword_9()); - // InternalComputation.g:290:3: ( (lv_problemSizeExpr_10_0= ruleSummationExpression ) ) - // InternalComputation.g:291:4: (lv_problemSizeExpr_10_0= ruleSummationExpression ) + // InternalComputation.g:309:3: ( (lv_problemSizeExpr_10_0= ruleSummationExpression ) ) + // InternalComputation.g:310:4: (lv_problemSizeExpr_10_0= ruleSummationExpression ) { - // InternalComputation.g:291:4: (lv_problemSizeExpr_10_0= ruleSummationExpression ) - // InternalComputation.g:292:5: lv_problemSizeExpr_10_0= ruleSummationExpression + // InternalComputation.g:310:4: (lv_problemSizeExpr_10_0= ruleSummationExpression ) + // InternalComputation.g:311:5: lv_problemSizeExpr_10_0= ruleSummationExpression { newCompositeNode(grammarAccess.getHWTargetDesignAccess().getProblemSizeExprSummationExpressionParserRuleCall_10_0()); @@ -654,8 +706,197 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR end "ruleHWTargetDesign" + // $ANTLR start "entryRuleBlockGroup" + // InternalComputation.g:336:1: entryRuleBlockGroup returns [EObject current=null] : iv_ruleBlockGroup= ruleBlockGroup EOF ; + public final EObject entryRuleBlockGroup() throws RecognitionException { + EObject current = null; + + EObject iv_ruleBlockGroup = null; + + + try { + // InternalComputation.g:336:51: (iv_ruleBlockGroup= ruleBlockGroup EOF ) + // InternalComputation.g:337:2: iv_ruleBlockGroup= ruleBlockGroup EOF + { + newCompositeNode(grammarAccess.getBlockGroupRule()); + pushFollow(FOLLOW_1); + iv_ruleBlockGroup=ruleBlockGroup(); + + state._fsp--; + + current =iv_ruleBlockGroup; + match(input,EOF,FOLLOW_2); + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleBlockGroup" + + + // $ANTLR start "ruleBlockGroup" + // InternalComputation.g:343:1: ruleBlockGroup returns [EObject current=null] : (otherlv_0= 'group' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (otherlv_3= RULE_ID ) ) (otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) )* otherlv_6= '}' ) ; + public final EObject ruleBlockGroup() throws RecognitionException { + EObject current = null; + + Token otherlv_0=null; + Token lv_name_1_0=null; + Token otherlv_2=null; + Token otherlv_3=null; + Token otherlv_4=null; + Token otherlv_5=null; + Token otherlv_6=null; + + + enterRule(); + + try { + // InternalComputation.g:349:2: ( (otherlv_0= 'group' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (otherlv_3= RULE_ID ) ) (otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) )* otherlv_6= '}' ) ) + // InternalComputation.g:350:2: (otherlv_0= 'group' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (otherlv_3= RULE_ID ) ) (otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) )* otherlv_6= '}' ) + { + // InternalComputation.g:350:2: (otherlv_0= 'group' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (otherlv_3= RULE_ID ) ) (otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) )* otherlv_6= '}' ) + // InternalComputation.g:351:3: otherlv_0= 'group' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (otherlv_3= RULE_ID ) ) (otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) )* otherlv_6= '}' + { + otherlv_0=(Token)match(input,20,FOLLOW_6); + + newLeafNode(otherlv_0, grammarAccess.getBlockGroupAccess().getGroupKeyword_0()); + + // InternalComputation.g:355:3: ( (lv_name_1_0= RULE_ID ) ) + // InternalComputation.g:356:4: (lv_name_1_0= RULE_ID ) + { + // InternalComputation.g:356:4: (lv_name_1_0= RULE_ID ) + // InternalComputation.g:357:5: lv_name_1_0= RULE_ID + { + lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_10); + + newLeafNode(lv_name_1_0, grammarAccess.getBlockGroupAccess().getNameIDTerminalRuleCall_1_0()); + + + if (current==null) { + current = createModelElement(grammarAccess.getBlockGroupRule()); + } + setWithLastConsumed( + current, + "name", + lv_name_1_0, + "org.eclipse.xtext.common.Terminals.ID"); + + + } + + + } + + otherlv_2=(Token)match(input,15,FOLLOW_6); + + newLeafNode(otherlv_2, grammarAccess.getBlockGroupAccess().getLeftCurlyBracketKeyword_2()); + + // InternalComputation.g:377:3: ( (otherlv_3= RULE_ID ) ) + // InternalComputation.g:378:4: (otherlv_3= RULE_ID ) + { + // InternalComputation.g:378:4: (otherlv_3= RULE_ID ) + // InternalComputation.g:379:5: otherlv_3= RULE_ID + { + + if (current==null) { + current = createModelElement(grammarAccess.getBlockGroupRule()); + } + + otherlv_3=(Token)match(input,RULE_ID,FOLLOW_16); + + newLeafNode(otherlv_3, grammarAccess.getBlockGroupAccess().getBlocksComputationBlockCrossReference_3_0()); + + + } + + + } + + // InternalComputation.g:390:3: (otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) )* + loop4: + do { + int alt4=2; + int LA4_0 = input.LA(1); + + if ( (LA4_0==21) ) { + alt4=1; + } + + + switch (alt4) { + case 1 : + // InternalComputation.g:391:4: otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) + { + otherlv_4=(Token)match(input,21,FOLLOW_6); + + newLeafNode(otherlv_4, grammarAccess.getBlockGroupAccess().getCommaKeyword_4_0()); + + // InternalComputation.g:395:4: ( (otherlv_5= RULE_ID ) ) + // InternalComputation.g:396:5: (otherlv_5= RULE_ID ) + { + // InternalComputation.g:396:5: (otherlv_5= RULE_ID ) + // InternalComputation.g:397:6: otherlv_5= RULE_ID + { + + if (current==null) { + current = createModelElement(grammarAccess.getBlockGroupRule()); + } + + otherlv_5=(Token)match(input,RULE_ID,FOLLOW_16); + + newLeafNode(otherlv_5, grammarAccess.getBlockGroupAccess().getBlocksComputationBlockCrossReference_4_1_0()); + + + } + + + } + + + } + break; + + default : + break loop4; + } + } while (true); + + otherlv_6=(Token)match(input,19,FOLLOW_2); + + newLeafNode(otherlv_6, grammarAccess.getBlockGroupAccess().getRightCurlyBracketKeyword_5()); + + + } + + + } + + + leaveRule(); + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleBlockGroup" + + // $ANTLR start "entryRuleComputationBlock" - // InternalComputation.g:317:1: entryRuleComputationBlock returns [EObject current=null] : iv_ruleComputationBlock= ruleComputationBlock EOF ; + // InternalComputation.g:417:1: entryRuleComputationBlock returns [EObject current=null] : iv_ruleComputationBlock= ruleComputationBlock EOF ; public final EObject entryRuleComputationBlock() throws RecognitionException { EObject current = null; @@ -663,8 +904,8 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { try { - // InternalComputation.g:317:57: (iv_ruleComputationBlock= ruleComputationBlock EOF ) - // InternalComputation.g:318:2: iv_ruleComputationBlock= ruleComputationBlock EOF + // InternalComputation.g:417:57: (iv_ruleComputationBlock= ruleComputationBlock EOF ) + // InternalComputation.g:418:2: iv_ruleComputationBlock= ruleComputationBlock EOF { newCompositeNode(grammarAccess.getComputationBlockRule()); pushFollow(FOLLOW_1); @@ -691,7 +932,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleComputationBlock" - // InternalComputation.g:324:1: ruleComputationBlock returns [EObject current=null] : (otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_operations_3_0= ruleOperation ) )+ otherlv_4= '}' ) ; + // InternalComputation.g:424:1: ruleComputationBlock returns [EObject current=null] : (otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_operations_3_0= ruleOperation ) )+ otherlv_4= '}' ) ; public final EObject ruleComputationBlock() throws RecognitionException { EObject current = null; @@ -706,21 +947,21 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalComputation.g:330:2: ( (otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_operations_3_0= ruleOperation ) )+ otherlv_4= '}' ) ) - // InternalComputation.g:331:2: (otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_operations_3_0= ruleOperation ) )+ otherlv_4= '}' ) + // InternalComputation.g:430:2: ( (otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_operations_3_0= ruleOperation ) )+ otherlv_4= '}' ) ) + // InternalComputation.g:431:2: (otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_operations_3_0= ruleOperation ) )+ otherlv_4= '}' ) { - // InternalComputation.g:331:2: (otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_operations_3_0= ruleOperation ) )+ otherlv_4= '}' ) - // InternalComputation.g:332:3: otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_operations_3_0= ruleOperation ) )+ otherlv_4= '}' + // InternalComputation.g:431:2: (otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_operations_3_0= ruleOperation ) )+ otherlv_4= '}' ) + // InternalComputation.g:432:3: otherlv_0= 'block' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_operations_3_0= ruleOperation ) )+ otherlv_4= '}' { - otherlv_0=(Token)match(input,20,FOLLOW_6); + otherlv_0=(Token)match(input,22,FOLLOW_6); newLeafNode(otherlv_0, grammarAccess.getComputationBlockAccess().getBlockKeyword_0()); - // InternalComputation.g:336:3: ( (lv_name_1_0= RULE_ID ) ) - // InternalComputation.g:337:4: (lv_name_1_0= RULE_ID ) + // InternalComputation.g:436:3: ( (lv_name_1_0= RULE_ID ) ) + // InternalComputation.g:437:4: (lv_name_1_0= RULE_ID ) { - // InternalComputation.g:337:4: (lv_name_1_0= RULE_ID ) - // InternalComputation.g:338:5: lv_name_1_0= RULE_ID + // InternalComputation.g:437:4: (lv_name_1_0= RULE_ID ) + // InternalComputation.g:438:5: lv_name_1_0= RULE_ID { lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_10); @@ -742,33 +983,33 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } - otherlv_2=(Token)match(input,15,FOLLOW_16); + otherlv_2=(Token)match(input,15,FOLLOW_17); newLeafNode(otherlv_2, grammarAccess.getComputationBlockAccess().getLeftCurlyBracketKeyword_2()); - // InternalComputation.g:358:3: ( (lv_operations_3_0= ruleOperation ) )+ - int cnt3=0; - loop3: + // InternalComputation.g:458:3: ( (lv_operations_3_0= ruleOperation ) )+ + int cnt5=0; + loop5: do { - int alt3=2; - int LA3_0 = input.LA(1); + int alt5=2; + int LA5_0 = input.LA(1); - if ( ((LA3_0>=21 && LA3_0<=22)) ) { - alt3=1; + if ( ((LA5_0>=23 && LA5_0<=24)) ) { + alt5=1; } - switch (alt3) { + switch (alt5) { case 1 : - // InternalComputation.g:359:4: (lv_operations_3_0= ruleOperation ) + // InternalComputation.g:459:4: (lv_operations_3_0= ruleOperation ) { - // InternalComputation.g:359:4: (lv_operations_3_0= ruleOperation ) - // InternalComputation.g:360:5: lv_operations_3_0= ruleOperation + // InternalComputation.g:459:4: (lv_operations_3_0= ruleOperation ) + // InternalComputation.g:460:5: lv_operations_3_0= ruleOperation { newCompositeNode(grammarAccess.getComputationBlockAccess().getOperationsOperationParserRuleCall_3_0()); - pushFollow(FOLLOW_17); + pushFollow(FOLLOW_18); lv_operations_3_0=ruleOperation(); state._fsp--; @@ -792,12 +1033,12 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { break; default : - if ( cnt3 >= 1 ) break loop3; + if ( cnt5 >= 1 ) break loop5; EarlyExitException eee = - new EarlyExitException(3, input); + new EarlyExitException(5, input); throw eee; } - cnt3++; + cnt5++; } while (true); otherlv_4=(Token)match(input,19,FOLLOW_2); @@ -827,7 +1068,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "entryRuleOP" - // InternalComputation.g:385:1: entryRuleOP returns [String current=null] : iv_ruleOP= ruleOP EOF ; + // InternalComputation.g:485:1: entryRuleOP returns [String current=null] : iv_ruleOP= ruleOP EOF ; public final String entryRuleOP() throws RecognitionException { String current = null; @@ -835,8 +1076,8 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { try { - // InternalComputation.g:385:42: (iv_ruleOP= ruleOP EOF ) - // InternalComputation.g:386:2: iv_ruleOP= ruleOP EOF + // InternalComputation.g:485:42: (iv_ruleOP= ruleOP EOF ) + // InternalComputation.g:486:2: iv_ruleOP= ruleOP EOF { newCompositeNode(grammarAccess.getOPRule()); pushFollow(FOLLOW_1); @@ -863,7 +1104,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleOP" - // InternalComputation.g:392:1: ruleOP returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (kw= 'ADD' | kw= 'MUL' ) ; + // InternalComputation.g:492:1: ruleOP returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (kw= 'ADD' | kw= 'MUL' ) ; public final AntlrDatatypeRuleToken ruleOP() throws RecognitionException { AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); @@ -873,30 +1114,30 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalComputation.g:398:2: ( (kw= 'ADD' | kw= 'MUL' ) ) - // InternalComputation.g:399:2: (kw= 'ADD' | kw= 'MUL' ) + // InternalComputation.g:498:2: ( (kw= 'ADD' | kw= 'MUL' ) ) + // InternalComputation.g:499:2: (kw= 'ADD' | kw= 'MUL' ) { - // InternalComputation.g:399:2: (kw= 'ADD' | kw= 'MUL' ) - int alt4=2; - int LA4_0 = input.LA(1); + // InternalComputation.g:499:2: (kw= 'ADD' | kw= 'MUL' ) + int alt6=2; + int LA6_0 = input.LA(1); - if ( (LA4_0==21) ) { - alt4=1; + if ( (LA6_0==23) ) { + alt6=1; } - else if ( (LA4_0==22) ) { - alt4=2; + else if ( (LA6_0==24) ) { + alt6=2; } else { NoViableAltException nvae = - new NoViableAltException("", 4, 0, input); + new NoViableAltException("", 6, 0, input); throw nvae; } - switch (alt4) { + switch (alt6) { case 1 : - // InternalComputation.g:400:3: kw= 'ADD' + // InternalComputation.g:500:3: kw= 'ADD' { - kw=(Token)match(input,21,FOLLOW_2); + kw=(Token)match(input,23,FOLLOW_2); current.merge(kw); newLeafNode(kw, grammarAccess.getOPAccess().getADDKeyword_0()); @@ -905,9 +1146,9 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } break; case 2 : - // InternalComputation.g:406:3: kw= 'MUL' + // InternalComputation.g:506:3: kw= 'MUL' { - kw=(Token)match(input,22,FOLLOW_2); + kw=(Token)match(input,24,FOLLOW_2); current.merge(kw); newLeafNode(kw, grammarAccess.getOPAccess().getMULKeyword_1()); @@ -938,7 +1179,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "entryRuleOperation" - // InternalComputation.g:415:1: entryRuleOperation returns [EObject current=null] : iv_ruleOperation= ruleOperation EOF ; + // InternalComputation.g:515:1: entryRuleOperation returns [EObject current=null] : iv_ruleOperation= ruleOperation EOF ; public final EObject entryRuleOperation() throws RecognitionException { EObject current = null; @@ -946,8 +1187,8 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { try { - // InternalComputation.g:415:50: (iv_ruleOperation= ruleOperation EOF ) - // InternalComputation.g:416:2: iv_ruleOperation= ruleOperation EOF + // InternalComputation.g:515:50: (iv_ruleOperation= ruleOperation EOF ) + // InternalComputation.g:516:2: iv_ruleOperation= ruleOperation EOF { newCompositeNode(grammarAccess.getOperationRule()); pushFollow(FOLLOW_1); @@ -974,7 +1215,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleOperation" - // InternalComputation.g:422:1: ruleOperation returns [EObject current=null] : ( ( (lv_opType_0_0= ruleOP ) ) otherlv_1= ':' ( (lv_outputExpr_2_0= ruleOperandExpression ) ) otherlv_3= '=' ( (lv_inputExpr1_4_0= ruleOperandExpression ) ) otherlv_5= 'op' ( (lv_inputExpr2_6_0= ruleOperandExpression ) ) otherlv_7= 'x' ( (lv_numOps_8_0= ruleSummationExpression ) ) otherlv_9= ';' ) ; + // InternalComputation.g:522:1: ruleOperation returns [EObject current=null] : ( ( (lv_opType_0_0= ruleOP ) ) otherlv_1= ':' ( (lv_outputExpr_2_0= ruleOperandExpression ) ) otherlv_3= '=' ( (lv_inputExpr1_4_0= ruleOperandExpression ) ) otherlv_5= 'op' ( (lv_inputExpr2_6_0= ruleOperandExpression ) ) otherlv_7= 'x' ( (lv_numOps_8_0= ruleSummationExpression ) ) otherlv_9= ';' ) ; public final EObject ruleOperation() throws RecognitionException { EObject current = null; @@ -998,22 +1239,22 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalComputation.g:428:2: ( ( ( (lv_opType_0_0= ruleOP ) ) otherlv_1= ':' ( (lv_outputExpr_2_0= ruleOperandExpression ) ) otherlv_3= '=' ( (lv_inputExpr1_4_0= ruleOperandExpression ) ) otherlv_5= 'op' ( (lv_inputExpr2_6_0= ruleOperandExpression ) ) otherlv_7= 'x' ( (lv_numOps_8_0= ruleSummationExpression ) ) otherlv_9= ';' ) ) - // InternalComputation.g:429:2: ( ( (lv_opType_0_0= ruleOP ) ) otherlv_1= ':' ( (lv_outputExpr_2_0= ruleOperandExpression ) ) otherlv_3= '=' ( (lv_inputExpr1_4_0= ruleOperandExpression ) ) otherlv_5= 'op' ( (lv_inputExpr2_6_0= ruleOperandExpression ) ) otherlv_7= 'x' ( (lv_numOps_8_0= ruleSummationExpression ) ) otherlv_9= ';' ) + // InternalComputation.g:528:2: ( ( ( (lv_opType_0_0= ruleOP ) ) otherlv_1= ':' ( (lv_outputExpr_2_0= ruleOperandExpression ) ) otherlv_3= '=' ( (lv_inputExpr1_4_0= ruleOperandExpression ) ) otherlv_5= 'op' ( (lv_inputExpr2_6_0= ruleOperandExpression ) ) otherlv_7= 'x' ( (lv_numOps_8_0= ruleSummationExpression ) ) otherlv_9= ';' ) ) + // InternalComputation.g:529:2: ( ( (lv_opType_0_0= ruleOP ) ) otherlv_1= ':' ( (lv_outputExpr_2_0= ruleOperandExpression ) ) otherlv_3= '=' ( (lv_inputExpr1_4_0= ruleOperandExpression ) ) otherlv_5= 'op' ( (lv_inputExpr2_6_0= ruleOperandExpression ) ) otherlv_7= 'x' ( (lv_numOps_8_0= ruleSummationExpression ) ) otherlv_9= ';' ) { - // InternalComputation.g:429:2: ( ( (lv_opType_0_0= ruleOP ) ) otherlv_1= ':' ( (lv_outputExpr_2_0= ruleOperandExpression ) ) otherlv_3= '=' ( (lv_inputExpr1_4_0= ruleOperandExpression ) ) otherlv_5= 'op' ( (lv_inputExpr2_6_0= ruleOperandExpression ) ) otherlv_7= 'x' ( (lv_numOps_8_0= ruleSummationExpression ) ) otherlv_9= ';' ) - // InternalComputation.g:430:3: ( (lv_opType_0_0= ruleOP ) ) otherlv_1= ':' ( (lv_outputExpr_2_0= ruleOperandExpression ) ) otherlv_3= '=' ( (lv_inputExpr1_4_0= ruleOperandExpression ) ) otherlv_5= 'op' ( (lv_inputExpr2_6_0= ruleOperandExpression ) ) otherlv_7= 'x' ( (lv_numOps_8_0= ruleSummationExpression ) ) otherlv_9= ';' + // InternalComputation.g:529:2: ( ( (lv_opType_0_0= ruleOP ) ) otherlv_1= ':' ( (lv_outputExpr_2_0= ruleOperandExpression ) ) otherlv_3= '=' ( (lv_inputExpr1_4_0= ruleOperandExpression ) ) otherlv_5= 'op' ( (lv_inputExpr2_6_0= ruleOperandExpression ) ) otherlv_7= 'x' ( (lv_numOps_8_0= ruleSummationExpression ) ) otherlv_9= ';' ) + // InternalComputation.g:530:3: ( (lv_opType_0_0= ruleOP ) ) otherlv_1= ':' ( (lv_outputExpr_2_0= ruleOperandExpression ) ) otherlv_3= '=' ( (lv_inputExpr1_4_0= ruleOperandExpression ) ) otherlv_5= 'op' ( (lv_inputExpr2_6_0= ruleOperandExpression ) ) otherlv_7= 'x' ( (lv_numOps_8_0= ruleSummationExpression ) ) otherlv_9= ';' { - // InternalComputation.g:430:3: ( (lv_opType_0_0= ruleOP ) ) - // InternalComputation.g:431:4: (lv_opType_0_0= ruleOP ) + // InternalComputation.g:530:3: ( (lv_opType_0_0= ruleOP ) ) + // InternalComputation.g:531:4: (lv_opType_0_0= ruleOP ) { - // InternalComputation.g:431:4: (lv_opType_0_0= ruleOP ) - // InternalComputation.g:432:5: lv_opType_0_0= ruleOP + // InternalComputation.g:531:4: (lv_opType_0_0= ruleOP ) + // InternalComputation.g:532:5: lv_opType_0_0= ruleOP { newCompositeNode(grammarAccess.getOperationAccess().getOpTypeOPParserRuleCall_0_0()); - pushFollow(FOLLOW_18); + pushFollow(FOLLOW_19); lv_opType_0_0=ruleOP(); state._fsp--; @@ -1035,15 +1276,15 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } - otherlv_1=(Token)match(input,23,FOLLOW_19); + otherlv_1=(Token)match(input,25,FOLLOW_20); newLeafNode(otherlv_1, grammarAccess.getOperationAccess().getColonKeyword_1()); - // InternalComputation.g:453:3: ( (lv_outputExpr_2_0= ruleOperandExpression ) ) - // InternalComputation.g:454:4: (lv_outputExpr_2_0= ruleOperandExpression ) + // InternalComputation.g:553:3: ( (lv_outputExpr_2_0= ruleOperandExpression ) ) + // InternalComputation.g:554:4: (lv_outputExpr_2_0= ruleOperandExpression ) { - // InternalComputation.g:454:4: (lv_outputExpr_2_0= ruleOperandExpression ) - // InternalComputation.g:455:5: lv_outputExpr_2_0= ruleOperandExpression + // InternalComputation.g:554:4: (lv_outputExpr_2_0= ruleOperandExpression ) + // InternalComputation.g:555:5: lv_outputExpr_2_0= ruleOperandExpression { newCompositeNode(grammarAccess.getOperationAccess().getOutputExprOperandExpressionParserRuleCall_2_0()); @@ -1070,20 +1311,20 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } - otherlv_3=(Token)match(input,12,FOLLOW_19); + otherlv_3=(Token)match(input,12,FOLLOW_20); newLeafNode(otherlv_3, grammarAccess.getOperationAccess().getEqualsSignKeyword_3()); - // InternalComputation.g:476:3: ( (lv_inputExpr1_4_0= ruleOperandExpression ) ) - // InternalComputation.g:477:4: (lv_inputExpr1_4_0= ruleOperandExpression ) + // InternalComputation.g:576:3: ( (lv_inputExpr1_4_0= ruleOperandExpression ) ) + // InternalComputation.g:577:4: (lv_inputExpr1_4_0= ruleOperandExpression ) { - // InternalComputation.g:477:4: (lv_inputExpr1_4_0= ruleOperandExpression ) - // InternalComputation.g:478:5: lv_inputExpr1_4_0= ruleOperandExpression + // InternalComputation.g:577:4: (lv_inputExpr1_4_0= ruleOperandExpression ) + // InternalComputation.g:578:5: lv_inputExpr1_4_0= ruleOperandExpression { newCompositeNode(grammarAccess.getOperationAccess().getInputExpr1OperandExpressionParserRuleCall_4_0()); - pushFollow(FOLLOW_20); + pushFollow(FOLLOW_21); lv_inputExpr1_4_0=ruleOperandExpression(); state._fsp--; @@ -1105,20 +1346,20 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } - otherlv_5=(Token)match(input,24,FOLLOW_19); + otherlv_5=(Token)match(input,26,FOLLOW_20); newLeafNode(otherlv_5, grammarAccess.getOperationAccess().getOpKeyword_5()); - // InternalComputation.g:499:3: ( (lv_inputExpr2_6_0= ruleOperandExpression ) ) - // InternalComputation.g:500:4: (lv_inputExpr2_6_0= ruleOperandExpression ) + // InternalComputation.g:599:3: ( (lv_inputExpr2_6_0= ruleOperandExpression ) ) + // InternalComputation.g:600:4: (lv_inputExpr2_6_0= ruleOperandExpression ) { - // InternalComputation.g:500:4: (lv_inputExpr2_6_0= ruleOperandExpression ) - // InternalComputation.g:501:5: lv_inputExpr2_6_0= ruleOperandExpression + // InternalComputation.g:600:4: (lv_inputExpr2_6_0= ruleOperandExpression ) + // InternalComputation.g:601:5: lv_inputExpr2_6_0= ruleOperandExpression { newCompositeNode(grammarAccess.getOperationAccess().getInputExpr2OperandExpressionParserRuleCall_6_0()); - pushFollow(FOLLOW_21); + pushFollow(FOLLOW_22); lv_inputExpr2_6_0=ruleOperandExpression(); state._fsp--; @@ -1140,15 +1381,15 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } - otherlv_7=(Token)match(input,25,FOLLOW_14); + otherlv_7=(Token)match(input,27,FOLLOW_14); newLeafNode(otherlv_7, grammarAccess.getOperationAccess().getXKeyword_7()); - // InternalComputation.g:522:3: ( (lv_numOps_8_0= ruleSummationExpression ) ) - // InternalComputation.g:523:4: (lv_numOps_8_0= ruleSummationExpression ) + // InternalComputation.g:622:3: ( (lv_numOps_8_0= ruleSummationExpression ) ) + // InternalComputation.g:623:4: (lv_numOps_8_0= ruleSummationExpression ) { - // InternalComputation.g:523:4: (lv_numOps_8_0= ruleSummationExpression ) - // InternalComputation.g:524:5: lv_numOps_8_0= ruleSummationExpression + // InternalComputation.g:623:4: (lv_numOps_8_0= ruleSummationExpression ) + // InternalComputation.g:624:5: lv_numOps_8_0= ruleSummationExpression { newCompositeNode(grammarAccess.getOperationAccess().getNumOpsSummationExpressionParserRuleCall_8_0()); @@ -1202,7 +1443,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "entryRuleOperandExpression" - // InternalComputation.g:549:1: entryRuleOperandExpression returns [EObject current=null] : iv_ruleOperandExpression= ruleOperandExpression EOF ; + // InternalComputation.g:649:1: entryRuleOperandExpression returns [EObject current=null] : iv_ruleOperandExpression= ruleOperandExpression EOF ; public final EObject entryRuleOperandExpression() throws RecognitionException { EObject current = null; @@ -1210,8 +1451,8 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { try { - // InternalComputation.g:549:58: (iv_ruleOperandExpression= ruleOperandExpression EOF ) - // InternalComputation.g:550:2: iv_ruleOperandExpression= ruleOperandExpression EOF + // InternalComputation.g:649:58: (iv_ruleOperandExpression= ruleOperandExpression EOF ) + // InternalComputation.g:650:2: iv_ruleOperandExpression= ruleOperandExpression EOF { newCompositeNode(grammarAccess.getOperandExpressionRule()); pushFollow(FOLLOW_1); @@ -1238,7 +1479,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleOperandExpression" - // InternalComputation.g:556:1: ruleOperandExpression returns [EObject current=null] : (this_MaxExpression_0= ruleMaxExpression | this_TerminalOperandExpression_1= ruleTerminalOperandExpression ) ; + // InternalComputation.g:656:1: ruleOperandExpression returns [EObject current=null] : (this_MaxExpression_0= ruleMaxExpression | this_TerminalOperandExpression_1= ruleTerminalOperandExpression ) ; public final EObject ruleOperandExpression() throws RecognitionException { EObject current = null; @@ -1251,28 +1492,28 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalComputation.g:562:2: ( (this_MaxExpression_0= ruleMaxExpression | this_TerminalOperandExpression_1= ruleTerminalOperandExpression ) ) - // InternalComputation.g:563:2: (this_MaxExpression_0= ruleMaxExpression | this_TerminalOperandExpression_1= ruleTerminalOperandExpression ) + // InternalComputation.g:662:2: ( (this_MaxExpression_0= ruleMaxExpression | this_TerminalOperandExpression_1= ruleTerminalOperandExpression ) ) + // InternalComputation.g:663:2: (this_MaxExpression_0= ruleMaxExpression | this_TerminalOperandExpression_1= ruleTerminalOperandExpression ) { - // InternalComputation.g:563:2: (this_MaxExpression_0= ruleMaxExpression | this_TerminalOperandExpression_1= ruleTerminalOperandExpression ) - int alt5=2; - int LA5_0 = input.LA(1); + // InternalComputation.g:663:2: (this_MaxExpression_0= ruleMaxExpression | this_TerminalOperandExpression_1= ruleTerminalOperandExpression ) + int alt7=2; + int LA7_0 = input.LA(1); - if ( (LA5_0==26) ) { - alt5=1; + if ( (LA7_0==28) ) { + alt7=1; } - else if ( ((LA5_0>=RULE_ID && LA5_0<=RULE_INT)||LA5_0==27) ) { - alt5=2; + else if ( ((LA7_0>=RULE_ID && LA7_0<=RULE_INT)||LA7_0==29) ) { + alt7=2; } else { NoViableAltException nvae = - new NoViableAltException("", 5, 0, input); + new NoViableAltException("", 7, 0, input); throw nvae; } - switch (alt5) { + switch (alt7) { case 1 : - // InternalComputation.g:564:3: this_MaxExpression_0= ruleMaxExpression + // InternalComputation.g:664:3: this_MaxExpression_0= ruleMaxExpression { newCompositeNode(grammarAccess.getOperandExpressionAccess().getMaxExpressionParserRuleCall_0()); @@ -1290,7 +1531,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } break; case 2 : - // InternalComputation.g:573:3: this_TerminalOperandExpression_1= ruleTerminalOperandExpression + // InternalComputation.g:673:3: this_TerminalOperandExpression_1= ruleTerminalOperandExpression { newCompositeNode(grammarAccess.getOperandExpressionAccess().getTerminalOperandExpressionParserRuleCall_1()); @@ -1330,7 +1571,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "entryRuleMaxExpression" - // InternalComputation.g:585:1: entryRuleMaxExpression returns [EObject current=null] : iv_ruleMaxExpression= ruleMaxExpression EOF ; + // InternalComputation.g:685:1: entryRuleMaxExpression returns [EObject current=null] : iv_ruleMaxExpression= ruleMaxExpression EOF ; public final EObject entryRuleMaxExpression() throws RecognitionException { EObject current = null; @@ -1338,8 +1579,8 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { try { - // InternalComputation.g:585:54: (iv_ruleMaxExpression= ruleMaxExpression EOF ) - // InternalComputation.g:586:2: iv_ruleMaxExpression= ruleMaxExpression EOF + // InternalComputation.g:685:54: (iv_ruleMaxExpression= ruleMaxExpression EOF ) + // InternalComputation.g:686:2: iv_ruleMaxExpression= ruleMaxExpression EOF { newCompositeNode(grammarAccess.getMaxExpressionRule()); pushFollow(FOLLOW_1); @@ -1366,7 +1607,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleMaxExpression" - // InternalComputation.g:592:1: ruleMaxExpression returns [EObject current=null] : (otherlv_0= 'max' otherlv_1= '(' ( (lv_exprs_2_0= ruleTerminalOperandExpression ) ) (otherlv_3= ',' ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) )+ otherlv_5= ')' ) ; + // InternalComputation.g:692:1: ruleMaxExpression returns [EObject current=null] : (otherlv_0= 'max' otherlv_1= '(' ( (lv_exprs_2_0= ruleTerminalOperandExpression ) ) (otherlv_3= ',' ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) )+ otherlv_5= ')' ) ; public final EObject ruleMaxExpression() throws RecognitionException { EObject current = null; @@ -1383,30 +1624,30 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalComputation.g:598:2: ( (otherlv_0= 'max' otherlv_1= '(' ( (lv_exprs_2_0= ruleTerminalOperandExpression ) ) (otherlv_3= ',' ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) )+ otherlv_5= ')' ) ) - // InternalComputation.g:599:2: (otherlv_0= 'max' otherlv_1= '(' ( (lv_exprs_2_0= ruleTerminalOperandExpression ) ) (otherlv_3= ',' ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) )+ otherlv_5= ')' ) + // InternalComputation.g:698:2: ( (otherlv_0= 'max' otherlv_1= '(' ( (lv_exprs_2_0= ruleTerminalOperandExpression ) ) (otherlv_3= ',' ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) )+ otherlv_5= ')' ) ) + // InternalComputation.g:699:2: (otherlv_0= 'max' otherlv_1= '(' ( (lv_exprs_2_0= ruleTerminalOperandExpression ) ) (otherlv_3= ',' ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) )+ otherlv_5= ')' ) { - // InternalComputation.g:599:2: (otherlv_0= 'max' otherlv_1= '(' ( (lv_exprs_2_0= ruleTerminalOperandExpression ) ) (otherlv_3= ',' ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) )+ otherlv_5= ')' ) - // InternalComputation.g:600:3: otherlv_0= 'max' otherlv_1= '(' ( (lv_exprs_2_0= ruleTerminalOperandExpression ) ) (otherlv_3= ',' ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) )+ otherlv_5= ')' + // InternalComputation.g:699:2: (otherlv_0= 'max' otherlv_1= '(' ( (lv_exprs_2_0= ruleTerminalOperandExpression ) ) (otherlv_3= ',' ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) )+ otherlv_5= ')' ) + // InternalComputation.g:700:3: otherlv_0= 'max' otherlv_1= '(' ( (lv_exprs_2_0= ruleTerminalOperandExpression ) ) (otherlv_3= ',' ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) )+ otherlv_5= ')' { - otherlv_0=(Token)match(input,26,FOLLOW_22); + otherlv_0=(Token)match(input,28,FOLLOW_23); newLeafNode(otherlv_0, grammarAccess.getMaxExpressionAccess().getMaxKeyword_0()); - otherlv_1=(Token)match(input,27,FOLLOW_19); + otherlv_1=(Token)match(input,29,FOLLOW_20); newLeafNode(otherlv_1, grammarAccess.getMaxExpressionAccess().getLeftParenthesisKeyword_1()); - // InternalComputation.g:608:3: ( (lv_exprs_2_0= ruleTerminalOperandExpression ) ) - // InternalComputation.g:609:4: (lv_exprs_2_0= ruleTerminalOperandExpression ) + // InternalComputation.g:708:3: ( (lv_exprs_2_0= ruleTerminalOperandExpression ) ) + // InternalComputation.g:709:4: (lv_exprs_2_0= ruleTerminalOperandExpression ) { - // InternalComputation.g:609:4: (lv_exprs_2_0= ruleTerminalOperandExpression ) - // InternalComputation.g:610:5: lv_exprs_2_0= ruleTerminalOperandExpression + // InternalComputation.g:709:4: (lv_exprs_2_0= ruleTerminalOperandExpression ) + // InternalComputation.g:710:5: lv_exprs_2_0= ruleTerminalOperandExpression { newCompositeNode(grammarAccess.getMaxExpressionAccess().getExprsTerminalOperandExpressionParserRuleCall_2_0()); - pushFollow(FOLLOW_23); + pushFollow(FOLLOW_24); lv_exprs_2_0=ruleTerminalOperandExpression(); state._fsp--; @@ -1428,36 +1669,36 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } - // InternalComputation.g:627:3: (otherlv_3= ',' ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) )+ - int cnt6=0; - loop6: + // InternalComputation.g:727:3: (otherlv_3= ',' ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) )+ + int cnt8=0; + loop8: do { - int alt6=2; - int LA6_0 = input.LA(1); + int alt8=2; + int LA8_0 = input.LA(1); - if ( (LA6_0==28) ) { - alt6=1; + if ( (LA8_0==21) ) { + alt8=1; } - switch (alt6) { + switch (alt8) { case 1 : - // InternalComputation.g:628:4: otherlv_3= ',' ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) + // InternalComputation.g:728:4: otherlv_3= ',' ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) { - otherlv_3=(Token)match(input,28,FOLLOW_19); + otherlv_3=(Token)match(input,21,FOLLOW_20); newLeafNode(otherlv_3, grammarAccess.getMaxExpressionAccess().getCommaKeyword_3_0()); - // InternalComputation.g:632:4: ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) - // InternalComputation.g:633:5: (lv_exprs_4_0= ruleTerminalOperandExpression ) + // InternalComputation.g:732:4: ( (lv_exprs_4_0= ruleTerminalOperandExpression ) ) + // InternalComputation.g:733:5: (lv_exprs_4_0= ruleTerminalOperandExpression ) { - // InternalComputation.g:633:5: (lv_exprs_4_0= ruleTerminalOperandExpression ) - // InternalComputation.g:634:6: lv_exprs_4_0= ruleTerminalOperandExpression + // InternalComputation.g:733:5: (lv_exprs_4_0= ruleTerminalOperandExpression ) + // InternalComputation.g:734:6: lv_exprs_4_0= ruleTerminalOperandExpression { newCompositeNode(grammarAccess.getMaxExpressionAccess().getExprsTerminalOperandExpressionParserRuleCall_3_1_0()); - pushFollow(FOLLOW_24); + pushFollow(FOLLOW_25); lv_exprs_4_0=ruleTerminalOperandExpression(); state._fsp--; @@ -1484,15 +1725,15 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { break; default : - if ( cnt6 >= 1 ) break loop6; + if ( cnt8 >= 1 ) break loop8; EarlyExitException eee = - new EarlyExitException(6, input); + new EarlyExitException(8, input); throw eee; } - cnt6++; + cnt8++; } while (true); - otherlv_5=(Token)match(input,29,FOLLOW_2); + otherlv_5=(Token)match(input,30,FOLLOW_2); newLeafNode(otherlv_5, grammarAccess.getMaxExpressionAccess().getRightParenthesisKeyword_4()); @@ -1519,7 +1760,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "entryRuleTerminalOperandExpression" - // InternalComputation.g:660:1: entryRuleTerminalOperandExpression returns [EObject current=null] : iv_ruleTerminalOperandExpression= ruleTerminalOperandExpression EOF ; + // InternalComputation.g:760:1: entryRuleTerminalOperandExpression returns [EObject current=null] : iv_ruleTerminalOperandExpression= ruleTerminalOperandExpression EOF ; public final EObject entryRuleTerminalOperandExpression() throws RecognitionException { EObject current = null; @@ -1527,8 +1768,8 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { try { - // InternalComputation.g:660:66: (iv_ruleTerminalOperandExpression= ruleTerminalOperandExpression EOF ) - // InternalComputation.g:661:2: iv_ruleTerminalOperandExpression= ruleTerminalOperandExpression EOF + // InternalComputation.g:760:66: (iv_ruleTerminalOperandExpression= ruleTerminalOperandExpression EOF ) + // InternalComputation.g:761:2: iv_ruleTerminalOperandExpression= ruleTerminalOperandExpression EOF { newCompositeNode(grammarAccess.getTerminalOperandExpressionRule()); pushFollow(FOLLOW_1); @@ -1555,7 +1796,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleTerminalOperandExpression" - // InternalComputation.g:667:1: ruleTerminalOperandExpression returns [EObject current=null] : (this_AddExpression_0= ruleAddExpression | this_OperandTerm_1= ruleOperandTerm ) ; + // InternalComputation.g:767:1: ruleTerminalOperandExpression returns [EObject current=null] : (this_AddExpression_0= ruleAddExpression | this_OperandTerm_1= ruleOperandTerm ) ; public final EObject ruleTerminalOperandExpression() throws RecognitionException { EObject current = null; @@ -1568,28 +1809,28 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalComputation.g:673:2: ( (this_AddExpression_0= ruleAddExpression | this_OperandTerm_1= ruleOperandTerm ) ) - // InternalComputation.g:674:2: (this_AddExpression_0= ruleAddExpression | this_OperandTerm_1= ruleOperandTerm ) + // InternalComputation.g:773:2: ( (this_AddExpression_0= ruleAddExpression | this_OperandTerm_1= ruleOperandTerm ) ) + // InternalComputation.g:774:2: (this_AddExpression_0= ruleAddExpression | this_OperandTerm_1= ruleOperandTerm ) { - // InternalComputation.g:674:2: (this_AddExpression_0= ruleAddExpression | this_OperandTerm_1= ruleOperandTerm ) - int alt7=2; - int LA7_0 = input.LA(1); + // InternalComputation.g:774:2: (this_AddExpression_0= ruleAddExpression | this_OperandTerm_1= ruleOperandTerm ) + int alt9=2; + int LA9_0 = input.LA(1); - if ( (LA7_0==27) ) { - alt7=1; + if ( (LA9_0==29) ) { + alt9=1; } - else if ( ((LA7_0>=RULE_ID && LA7_0<=RULE_INT)) ) { - alt7=2; + else if ( ((LA9_0>=RULE_ID && LA9_0<=RULE_INT)) ) { + alt9=2; } else { NoViableAltException nvae = - new NoViableAltException("", 7, 0, input); + new NoViableAltException("", 9, 0, input); throw nvae; } - switch (alt7) { + switch (alt9) { case 1 : - // InternalComputation.g:675:3: this_AddExpression_0= ruleAddExpression + // InternalComputation.g:775:3: this_AddExpression_0= ruleAddExpression { newCompositeNode(grammarAccess.getTerminalOperandExpressionAccess().getAddExpressionParserRuleCall_0()); @@ -1607,7 +1848,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } break; case 2 : - // InternalComputation.g:684:3: this_OperandTerm_1= ruleOperandTerm + // InternalComputation.g:784:3: this_OperandTerm_1= ruleOperandTerm { newCompositeNode(grammarAccess.getTerminalOperandExpressionAccess().getOperandTermParserRuleCall_1()); @@ -1647,7 +1888,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "entryRuleAddExpression" - // InternalComputation.g:696:1: entryRuleAddExpression returns [EObject current=null] : iv_ruleAddExpression= ruleAddExpression EOF ; + // InternalComputation.g:796:1: entryRuleAddExpression returns [EObject current=null] : iv_ruleAddExpression= ruleAddExpression EOF ; public final EObject entryRuleAddExpression() throws RecognitionException { EObject current = null; @@ -1655,8 +1896,8 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { try { - // InternalComputation.g:696:54: (iv_ruleAddExpression= ruleAddExpression EOF ) - // InternalComputation.g:697:2: iv_ruleAddExpression= ruleAddExpression EOF + // InternalComputation.g:796:54: (iv_ruleAddExpression= ruleAddExpression EOF ) + // InternalComputation.g:797:2: iv_ruleAddExpression= ruleAddExpression EOF { newCompositeNode(grammarAccess.getAddExpressionRule()); pushFollow(FOLLOW_1); @@ -1683,7 +1924,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleAddExpression" - // InternalComputation.g:703:1: ruleAddExpression returns [EObject current=null] : (otherlv_0= '(' ( (lv_op1_1_0= ruleOperandExpression ) ) otherlv_2= '+' ( (lv_op2_3_0= ruleOperandExpression ) ) otherlv_4= ')' ) ; + // InternalComputation.g:803:1: ruleAddExpression returns [EObject current=null] : (otherlv_0= '(' ( (lv_op1_1_0= ruleOperandExpression ) ) otherlv_2= '+' ( (lv_op2_3_0= ruleOperandExpression ) ) otherlv_4= ')' ) ; public final EObject ruleAddExpression() throws RecognitionException { EObject current = null; @@ -1699,26 +1940,26 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalComputation.g:709:2: ( (otherlv_0= '(' ( (lv_op1_1_0= ruleOperandExpression ) ) otherlv_2= '+' ( (lv_op2_3_0= ruleOperandExpression ) ) otherlv_4= ')' ) ) - // InternalComputation.g:710:2: (otherlv_0= '(' ( (lv_op1_1_0= ruleOperandExpression ) ) otherlv_2= '+' ( (lv_op2_3_0= ruleOperandExpression ) ) otherlv_4= ')' ) + // InternalComputation.g:809:2: ( (otherlv_0= '(' ( (lv_op1_1_0= ruleOperandExpression ) ) otherlv_2= '+' ( (lv_op2_3_0= ruleOperandExpression ) ) otherlv_4= ')' ) ) + // InternalComputation.g:810:2: (otherlv_0= '(' ( (lv_op1_1_0= ruleOperandExpression ) ) otherlv_2= '+' ( (lv_op2_3_0= ruleOperandExpression ) ) otherlv_4= ')' ) { - // InternalComputation.g:710:2: (otherlv_0= '(' ( (lv_op1_1_0= ruleOperandExpression ) ) otherlv_2= '+' ( (lv_op2_3_0= ruleOperandExpression ) ) otherlv_4= ')' ) - // InternalComputation.g:711:3: otherlv_0= '(' ( (lv_op1_1_0= ruleOperandExpression ) ) otherlv_2= '+' ( (lv_op2_3_0= ruleOperandExpression ) ) otherlv_4= ')' + // InternalComputation.g:810:2: (otherlv_0= '(' ( (lv_op1_1_0= ruleOperandExpression ) ) otherlv_2= '+' ( (lv_op2_3_0= ruleOperandExpression ) ) otherlv_4= ')' ) + // InternalComputation.g:811:3: otherlv_0= '(' ( (lv_op1_1_0= ruleOperandExpression ) ) otherlv_2= '+' ( (lv_op2_3_0= ruleOperandExpression ) ) otherlv_4= ')' { - otherlv_0=(Token)match(input,27,FOLLOW_19); + otherlv_0=(Token)match(input,29,FOLLOW_20); newLeafNode(otherlv_0, grammarAccess.getAddExpressionAccess().getLeftParenthesisKeyword_0()); - // InternalComputation.g:715:3: ( (lv_op1_1_0= ruleOperandExpression ) ) - // InternalComputation.g:716:4: (lv_op1_1_0= ruleOperandExpression ) + // InternalComputation.g:815:3: ( (lv_op1_1_0= ruleOperandExpression ) ) + // InternalComputation.g:816:4: (lv_op1_1_0= ruleOperandExpression ) { - // InternalComputation.g:716:4: (lv_op1_1_0= ruleOperandExpression ) - // InternalComputation.g:717:5: lv_op1_1_0= ruleOperandExpression + // InternalComputation.g:816:4: (lv_op1_1_0= ruleOperandExpression ) + // InternalComputation.g:817:5: lv_op1_1_0= ruleOperandExpression { newCompositeNode(grammarAccess.getAddExpressionAccess().getOp1OperandExpressionParserRuleCall_1_0()); - pushFollow(FOLLOW_25); + pushFollow(FOLLOW_26); lv_op1_1_0=ruleOperandExpression(); state._fsp--; @@ -1740,20 +1981,20 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } - otherlv_2=(Token)match(input,30,FOLLOW_19); + otherlv_2=(Token)match(input,31,FOLLOW_20); newLeafNode(otherlv_2, grammarAccess.getAddExpressionAccess().getPlusSignKeyword_2()); - // InternalComputation.g:738:3: ( (lv_op2_3_0= ruleOperandExpression ) ) - // InternalComputation.g:739:4: (lv_op2_3_0= ruleOperandExpression ) + // InternalComputation.g:838:3: ( (lv_op2_3_0= ruleOperandExpression ) ) + // InternalComputation.g:839:4: (lv_op2_3_0= ruleOperandExpression ) { - // InternalComputation.g:739:4: (lv_op2_3_0= ruleOperandExpression ) - // InternalComputation.g:740:5: lv_op2_3_0= ruleOperandExpression + // InternalComputation.g:839:4: (lv_op2_3_0= ruleOperandExpression ) + // InternalComputation.g:840:5: lv_op2_3_0= ruleOperandExpression { newCompositeNode(grammarAccess.getAddExpressionAccess().getOp2OperandExpressionParserRuleCall_3_0()); - pushFollow(FOLLOW_26); + pushFollow(FOLLOW_27); lv_op2_3_0=ruleOperandExpression(); state._fsp--; @@ -1775,7 +2016,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } - otherlv_4=(Token)match(input,29,FOLLOW_2); + otherlv_4=(Token)match(input,30,FOLLOW_2); newLeafNode(otherlv_4, grammarAccess.getAddExpressionAccess().getRightParenthesisKeyword_4()); @@ -1802,7 +2043,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "entryRuleOperandTerm" - // InternalComputation.g:765:1: entryRuleOperandTerm returns [EObject current=null] : iv_ruleOperandTerm= ruleOperandTerm EOF ; + // InternalComputation.g:865:1: entryRuleOperandTerm returns [EObject current=null] : iv_ruleOperandTerm= ruleOperandTerm EOF ; public final EObject entryRuleOperandTerm() throws RecognitionException { EObject current = null; @@ -1810,8 +2051,8 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { try { - // InternalComputation.g:765:52: (iv_ruleOperandTerm= ruleOperandTerm EOF ) - // InternalComputation.g:766:2: iv_ruleOperandTerm= ruleOperandTerm EOF + // InternalComputation.g:865:52: (iv_ruleOperandTerm= ruleOperandTerm EOF ) + // InternalComputation.g:866:2: iv_ruleOperandTerm= ruleOperandTerm EOF { newCompositeNode(grammarAccess.getOperandTermRule()); pushFollow(FOLLOW_1); @@ -1838,7 +2079,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleOperandTerm" - // InternalComputation.g:772:1: ruleOperandTerm returns [EObject current=null] : ( ( (lv_coef_0_0= RULE_INT ) )? ( (lv_name_1_0= RULE_ID ) ) ) ; + // InternalComputation.g:872:1: ruleOperandTerm returns [EObject current=null] : ( ( (lv_coef_0_0= RULE_INT ) )? ( (lv_name_1_0= RULE_ID ) ) ) ; public final EObject ruleOperandTerm() throws RecognitionException { EObject current = null; @@ -1849,25 +2090,25 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalComputation.g:778:2: ( ( ( (lv_coef_0_0= RULE_INT ) )? ( (lv_name_1_0= RULE_ID ) ) ) ) - // InternalComputation.g:779:2: ( ( (lv_coef_0_0= RULE_INT ) )? ( (lv_name_1_0= RULE_ID ) ) ) + // InternalComputation.g:878:2: ( ( ( (lv_coef_0_0= RULE_INT ) )? ( (lv_name_1_0= RULE_ID ) ) ) ) + // InternalComputation.g:879:2: ( ( (lv_coef_0_0= RULE_INT ) )? ( (lv_name_1_0= RULE_ID ) ) ) { - // InternalComputation.g:779:2: ( ( (lv_coef_0_0= RULE_INT ) )? ( (lv_name_1_0= RULE_ID ) ) ) - // InternalComputation.g:780:3: ( (lv_coef_0_0= RULE_INT ) )? ( (lv_name_1_0= RULE_ID ) ) + // InternalComputation.g:879:2: ( ( (lv_coef_0_0= RULE_INT ) )? ( (lv_name_1_0= RULE_ID ) ) ) + // InternalComputation.g:880:3: ( (lv_coef_0_0= RULE_INT ) )? ( (lv_name_1_0= RULE_ID ) ) { - // InternalComputation.g:780:3: ( (lv_coef_0_0= RULE_INT ) )? - int alt8=2; - int LA8_0 = input.LA(1); + // InternalComputation.g:880:3: ( (lv_coef_0_0= RULE_INT ) )? + int alt10=2; + int LA10_0 = input.LA(1); - if ( (LA8_0==RULE_INT) ) { - alt8=1; + if ( (LA10_0==RULE_INT) ) { + alt10=1; } - switch (alt8) { + switch (alt10) { case 1 : - // InternalComputation.g:781:4: (lv_coef_0_0= RULE_INT ) + // InternalComputation.g:881:4: (lv_coef_0_0= RULE_INT ) { - // InternalComputation.g:781:4: (lv_coef_0_0= RULE_INT ) - // InternalComputation.g:782:5: lv_coef_0_0= RULE_INT + // InternalComputation.g:881:4: (lv_coef_0_0= RULE_INT ) + // InternalComputation.g:882:5: lv_coef_0_0= RULE_INT { lv_coef_0_0=(Token)match(input,RULE_INT,FOLLOW_6); @@ -1892,11 +2133,11 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } - // InternalComputation.g:798:3: ( (lv_name_1_0= RULE_ID ) ) - // InternalComputation.g:799:4: (lv_name_1_0= RULE_ID ) + // InternalComputation.g:898:3: ( (lv_name_1_0= RULE_ID ) ) + // InternalComputation.g:899:4: (lv_name_1_0= RULE_ID ) { - // InternalComputation.g:799:4: (lv_name_1_0= RULE_ID ) - // InternalComputation.g:800:5: lv_name_1_0= RULE_ID + // InternalComputation.g:899:4: (lv_name_1_0= RULE_ID ) + // InternalComputation.g:900:5: lv_name_1_0= RULE_ID { lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_2); @@ -1941,7 +2182,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "entryRuleSummationExpression" - // InternalComputation.g:820:1: entryRuleSummationExpression returns [EObject current=null] : iv_ruleSummationExpression= ruleSummationExpression EOF ; + // InternalComputation.g:920:1: entryRuleSummationExpression returns [EObject current=null] : iv_ruleSummationExpression= ruleSummationExpression EOF ; public final EObject entryRuleSummationExpression() throws RecognitionException { EObject current = null; @@ -1949,8 +2190,8 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { try { - // InternalComputation.g:820:60: (iv_ruleSummationExpression= ruleSummationExpression EOF ) - // InternalComputation.g:821:2: iv_ruleSummationExpression= ruleSummationExpression EOF + // InternalComputation.g:920:60: (iv_ruleSummationExpression= ruleSummationExpression EOF ) + // InternalComputation.g:921:2: iv_ruleSummationExpression= ruleSummationExpression EOF { newCompositeNode(grammarAccess.getSummationExpressionRule()); pushFollow(FOLLOW_1); @@ -1977,7 +2218,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleSummationExpression" - // InternalComputation.g:827:1: ruleSummationExpression returns [EObject current=null] : ( ( ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? ) | ( (lv_constant_5_0= RULE_INT ) ) ) ; + // InternalComputation.g:927:1: ruleSummationExpression returns [EObject current=null] : ( ( ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? ) | ( (lv_constant_5_0= RULE_INT ) ) ) ; public final EObject ruleSummationExpression() throws RecognitionException { EObject current = null; @@ -1994,58 +2235,58 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalComputation.g:833:2: ( ( ( ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? ) | ( (lv_constant_5_0= RULE_INT ) ) ) ) - // InternalComputation.g:834:2: ( ( ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? ) | ( (lv_constant_5_0= RULE_INT ) ) ) + // InternalComputation.g:933:2: ( ( ( ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? ) | ( (lv_constant_5_0= RULE_INT ) ) ) ) + // InternalComputation.g:934:2: ( ( ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? ) | ( (lv_constant_5_0= RULE_INT ) ) ) { - // InternalComputation.g:834:2: ( ( ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? ) | ( (lv_constant_5_0= RULE_INT ) ) ) - int alt11=2; - int LA11_0 = input.LA(1); + // InternalComputation.g:934:2: ( ( ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? ) | ( (lv_constant_5_0= RULE_INT ) ) ) + int alt13=2; + int LA13_0 = input.LA(1); - if ( (LA11_0==RULE_INT) ) { - int LA11_1 = input.LA(2); + if ( (LA13_0==RULE_INT) ) { + int LA13_1 = input.LA(2); - if ( (LA11_1==EOF||LA11_1==13||LA11_1==19) ) { - alt11=2; + if ( (LA13_1==EOF||LA13_1==13||LA13_1==19) ) { + alt13=2; } - else if ( (LA11_1==RULE_ID) ) { - alt11=1; + else if ( (LA13_1==RULE_ID) ) { + alt13=1; } else { NoViableAltException nvae = - new NoViableAltException("", 11, 1, input); + new NoViableAltException("", 13, 1, input); throw nvae; } } - else if ( (LA11_0==RULE_ID) ) { - alt11=1; + else if ( (LA13_0==RULE_ID) ) { + alt13=1; } else { NoViableAltException nvae = - new NoViableAltException("", 11, 0, input); + new NoViableAltException("", 13, 0, input); throw nvae; } - switch (alt11) { + switch (alt13) { case 1 : - // InternalComputation.g:835:3: ( ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? ) + // InternalComputation.g:935:3: ( ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? ) { - // InternalComputation.g:835:3: ( ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? ) - // InternalComputation.g:836:4: ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? + // InternalComputation.g:935:3: ( ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? ) + // InternalComputation.g:936:4: ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? { - // InternalComputation.g:836:4: ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) - // InternalComputation.g:837:5: ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* + // InternalComputation.g:936:4: ( ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* ) + // InternalComputation.g:937:5: ( (lv_terms_0_0= ruleProductExpression ) ) (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* { - // InternalComputation.g:837:5: ( (lv_terms_0_0= ruleProductExpression ) ) - // InternalComputation.g:838:6: (lv_terms_0_0= ruleProductExpression ) + // InternalComputation.g:937:5: ( (lv_terms_0_0= ruleProductExpression ) ) + // InternalComputation.g:938:6: (lv_terms_0_0= ruleProductExpression ) { - // InternalComputation.g:838:6: (lv_terms_0_0= ruleProductExpression ) - // InternalComputation.g:839:7: lv_terms_0_0= ruleProductExpression + // InternalComputation.g:938:6: (lv_terms_0_0= ruleProductExpression ) + // InternalComputation.g:939:7: lv_terms_0_0= ruleProductExpression { newCompositeNode(grammarAccess.getSummationExpressionAccess().getTermsProductExpressionParserRuleCall_0_0_0_0()); - pushFollow(FOLLOW_27); + pushFollow(FOLLOW_28); lv_terms_0_0=ruleProductExpression(); state._fsp--; @@ -2067,50 +2308,50 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } - // InternalComputation.g:856:5: (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* - loop9: + // InternalComputation.g:956:5: (otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) )* + loop11: do { - int alt9=2; - int LA9_0 = input.LA(1); + int alt11=2; + int LA11_0 = input.LA(1); - if ( (LA9_0==30) ) { - int LA9_1 = input.LA(2); + if ( (LA11_0==31) ) { + int LA11_1 = input.LA(2); - if ( (LA9_1==RULE_INT) ) { - int LA9_3 = input.LA(3); + if ( (LA11_1==RULE_INT) ) { + int LA11_3 = input.LA(3); - if ( (LA9_3==RULE_ID) ) { - alt9=1; + if ( (LA11_3==RULE_ID) ) { + alt11=1; } } - else if ( (LA9_1==RULE_ID) ) { - alt9=1; + else if ( (LA11_1==RULE_ID) ) { + alt11=1; } } - switch (alt9) { + switch (alt11) { case 1 : - // InternalComputation.g:857:6: otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) + // InternalComputation.g:957:6: otherlv_1= '+' ( (lv_terms_2_0= ruleProductExpression ) ) { - otherlv_1=(Token)match(input,30,FOLLOW_14); + otherlv_1=(Token)match(input,31,FOLLOW_14); newLeafNode(otherlv_1, grammarAccess.getSummationExpressionAccess().getPlusSignKeyword_0_0_1_0()); - // InternalComputation.g:861:6: ( (lv_terms_2_0= ruleProductExpression ) ) - // InternalComputation.g:862:7: (lv_terms_2_0= ruleProductExpression ) + // InternalComputation.g:961:6: ( (lv_terms_2_0= ruleProductExpression ) ) + // InternalComputation.g:962:7: (lv_terms_2_0= ruleProductExpression ) { - // InternalComputation.g:862:7: (lv_terms_2_0= ruleProductExpression ) - // InternalComputation.g:863:8: lv_terms_2_0= ruleProductExpression + // InternalComputation.g:962:7: (lv_terms_2_0= ruleProductExpression ) + // InternalComputation.g:963:8: lv_terms_2_0= ruleProductExpression { newCompositeNode(grammarAccess.getSummationExpressionAccess().getTermsProductExpressionParserRuleCall_0_0_1_1_0()); - pushFollow(FOLLOW_27); + pushFollow(FOLLOW_28); lv_terms_2_0=ruleProductExpression(); state._fsp--; @@ -2137,33 +2378,33 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { break; default : - break loop9; + break loop11; } } while (true); } - // InternalComputation.g:882:4: (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? - int alt10=2; - int LA10_0 = input.LA(1); + // InternalComputation.g:982:4: (otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) )? + int alt12=2; + int LA12_0 = input.LA(1); - if ( (LA10_0==30) ) { - alt10=1; + if ( (LA12_0==31) ) { + alt12=1; } - switch (alt10) { + switch (alt12) { case 1 : - // InternalComputation.g:883:5: otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) + // InternalComputation.g:983:5: otherlv_3= '+' ( (lv_constant_4_0= RULE_INT ) ) { - otherlv_3=(Token)match(input,30,FOLLOW_8); + otherlv_3=(Token)match(input,31,FOLLOW_8); newLeafNode(otherlv_3, grammarAccess.getSummationExpressionAccess().getPlusSignKeyword_0_1_0()); - // InternalComputation.g:887:5: ( (lv_constant_4_0= RULE_INT ) ) - // InternalComputation.g:888:6: (lv_constant_4_0= RULE_INT ) + // InternalComputation.g:987:5: ( (lv_constant_4_0= RULE_INT ) ) + // InternalComputation.g:988:6: (lv_constant_4_0= RULE_INT ) { - // InternalComputation.g:888:6: (lv_constant_4_0= RULE_INT ) - // InternalComputation.g:889:7: lv_constant_4_0= RULE_INT + // InternalComputation.g:988:6: (lv_constant_4_0= RULE_INT ) + // InternalComputation.g:989:7: lv_constant_4_0= RULE_INT { lv_constant_4_0=(Token)match(input,RULE_INT,FOLLOW_2); @@ -2198,13 +2439,13 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } break; case 2 : - // InternalComputation.g:908:3: ( (lv_constant_5_0= RULE_INT ) ) + // InternalComputation.g:1008:3: ( (lv_constant_5_0= RULE_INT ) ) { - // InternalComputation.g:908:3: ( (lv_constant_5_0= RULE_INT ) ) - // InternalComputation.g:909:4: (lv_constant_5_0= RULE_INT ) + // InternalComputation.g:1008:3: ( (lv_constant_5_0= RULE_INT ) ) + // InternalComputation.g:1009:4: (lv_constant_5_0= RULE_INT ) { - // InternalComputation.g:909:4: (lv_constant_5_0= RULE_INT ) - // InternalComputation.g:910:5: lv_constant_5_0= RULE_INT + // InternalComputation.g:1009:4: (lv_constant_5_0= RULE_INT ) + // InternalComputation.g:1010:5: lv_constant_5_0= RULE_INT { lv_constant_5_0=(Token)match(input,RULE_INT,FOLLOW_2); @@ -2252,7 +2493,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "entryRuleProductExpression" - // InternalComputation.g:930:1: entryRuleProductExpression returns [EObject current=null] : iv_ruleProductExpression= ruleProductExpression EOF ; + // InternalComputation.g:1030:1: entryRuleProductExpression returns [EObject current=null] : iv_ruleProductExpression= ruleProductExpression EOF ; public final EObject entryRuleProductExpression() throws RecognitionException { EObject current = null; @@ -2260,8 +2501,8 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { try { - // InternalComputation.g:930:58: (iv_ruleProductExpression= ruleProductExpression EOF ) - // InternalComputation.g:931:2: iv_ruleProductExpression= ruleProductExpression EOF + // InternalComputation.g:1030:58: (iv_ruleProductExpression= ruleProductExpression EOF ) + // InternalComputation.g:1031:2: iv_ruleProductExpression= ruleProductExpression EOF { newCompositeNode(grammarAccess.getProductExpressionRule()); pushFollow(FOLLOW_1); @@ -2288,7 +2529,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleProductExpression" - // InternalComputation.g:937:1: ruleProductExpression returns [EObject current=null] : ( ( (lv_constant_0_0= RULE_INT ) )? ( ( (otherlv_1= RULE_ID ) ) ( (otherlv_2= RULE_ID ) )* ) ) ; + // InternalComputation.g:1037:1: ruleProductExpression returns [EObject current=null] : ( ( (lv_constant_0_0= RULE_INT ) )? ( ( (otherlv_1= RULE_ID ) ) ( (otherlv_2= RULE_ID ) )* ) ) ; public final EObject ruleProductExpression() throws RecognitionException { EObject current = null; @@ -2300,25 +2541,25 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalComputation.g:943:2: ( ( ( (lv_constant_0_0= RULE_INT ) )? ( ( (otherlv_1= RULE_ID ) ) ( (otherlv_2= RULE_ID ) )* ) ) ) - // InternalComputation.g:944:2: ( ( (lv_constant_0_0= RULE_INT ) )? ( ( (otherlv_1= RULE_ID ) ) ( (otherlv_2= RULE_ID ) )* ) ) + // InternalComputation.g:1043:2: ( ( ( (lv_constant_0_0= RULE_INT ) )? ( ( (otherlv_1= RULE_ID ) ) ( (otherlv_2= RULE_ID ) )* ) ) ) + // InternalComputation.g:1044:2: ( ( (lv_constant_0_0= RULE_INT ) )? ( ( (otherlv_1= RULE_ID ) ) ( (otherlv_2= RULE_ID ) )* ) ) { - // InternalComputation.g:944:2: ( ( (lv_constant_0_0= RULE_INT ) )? ( ( (otherlv_1= RULE_ID ) ) ( (otherlv_2= RULE_ID ) )* ) ) - // InternalComputation.g:945:3: ( (lv_constant_0_0= RULE_INT ) )? ( ( (otherlv_1= RULE_ID ) ) ( (otherlv_2= RULE_ID ) )* ) + // InternalComputation.g:1044:2: ( ( (lv_constant_0_0= RULE_INT ) )? ( ( (otherlv_1= RULE_ID ) ) ( (otherlv_2= RULE_ID ) )* ) ) + // InternalComputation.g:1045:3: ( (lv_constant_0_0= RULE_INT ) )? ( ( (otherlv_1= RULE_ID ) ) ( (otherlv_2= RULE_ID ) )* ) { - // InternalComputation.g:945:3: ( (lv_constant_0_0= RULE_INT ) )? - int alt12=2; - int LA12_0 = input.LA(1); + // InternalComputation.g:1045:3: ( (lv_constant_0_0= RULE_INT ) )? + int alt14=2; + int LA14_0 = input.LA(1); - if ( (LA12_0==RULE_INT) ) { - alt12=1; + if ( (LA14_0==RULE_INT) ) { + alt14=1; } - switch (alt12) { + switch (alt14) { case 1 : - // InternalComputation.g:946:4: (lv_constant_0_0= RULE_INT ) + // InternalComputation.g:1046:4: (lv_constant_0_0= RULE_INT ) { - // InternalComputation.g:946:4: (lv_constant_0_0= RULE_INT ) - // InternalComputation.g:947:5: lv_constant_0_0= RULE_INT + // InternalComputation.g:1046:4: (lv_constant_0_0= RULE_INT ) + // InternalComputation.g:1047:5: lv_constant_0_0= RULE_INT { lv_constant_0_0=(Token)match(input,RULE_INT,FOLLOW_6); @@ -2343,21 +2584,21 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } - // InternalComputation.g:963:3: ( ( (otherlv_1= RULE_ID ) ) ( (otherlv_2= RULE_ID ) )* ) - // InternalComputation.g:964:4: ( (otherlv_1= RULE_ID ) ) ( (otherlv_2= RULE_ID ) )* + // InternalComputation.g:1063:3: ( ( (otherlv_1= RULE_ID ) ) ( (otherlv_2= RULE_ID ) )* ) + // InternalComputation.g:1064:4: ( (otherlv_1= RULE_ID ) ) ( (otherlv_2= RULE_ID ) )* { - // InternalComputation.g:964:4: ( (otherlv_1= RULE_ID ) ) - // InternalComputation.g:965:5: (otherlv_1= RULE_ID ) + // InternalComputation.g:1064:4: ( (otherlv_1= RULE_ID ) ) + // InternalComputation.g:1065:5: (otherlv_1= RULE_ID ) { - // InternalComputation.g:965:5: (otherlv_1= RULE_ID ) - // InternalComputation.g:966:6: otherlv_1= RULE_ID + // InternalComputation.g:1065:5: (otherlv_1= RULE_ID ) + // InternalComputation.g:1066:6: otherlv_1= RULE_ID { if (current==null) { current = createModelElement(grammarAccess.getProductExpressionRule()); } - otherlv_1=(Token)match(input,RULE_ID,FOLLOW_28); + otherlv_1=(Token)match(input,RULE_ID,FOLLOW_29); newLeafNode(otherlv_1, grammarAccess.getProductExpressionAccess().getTermsParameterCrossReference_1_0_0()); @@ -2367,30 +2608,30 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { } - // InternalComputation.g:977:4: ( (otherlv_2= RULE_ID ) )* - loop13: + // InternalComputation.g:1077:4: ( (otherlv_2= RULE_ID ) )* + loop15: do { - int alt13=2; - int LA13_0 = input.LA(1); + int alt15=2; + int LA15_0 = input.LA(1); - if ( (LA13_0==RULE_ID) ) { - alt13=1; + if ( (LA15_0==RULE_ID) ) { + alt15=1; } - switch (alt13) { + switch (alt15) { case 1 : - // InternalComputation.g:978:5: (otherlv_2= RULE_ID ) + // InternalComputation.g:1078:5: (otherlv_2= RULE_ID ) { - // InternalComputation.g:978:5: (otherlv_2= RULE_ID ) - // InternalComputation.g:979:6: otherlv_2= RULE_ID + // InternalComputation.g:1078:5: (otherlv_2= RULE_ID ) + // InternalComputation.g:1079:6: otherlv_2= RULE_ID { if (current==null) { current = createModelElement(grammarAccess.getProductExpressionRule()); } - otherlv_2=(Token)match(input,RULE_ID,FOLLOW_28); + otherlv_2=(Token)match(input,RULE_ID,FOLLOW_29); newLeafNode(otherlv_2, grammarAccess.getProductExpressionAccess().getTermsParameterCrossReference_1_1_0()); @@ -2402,7 +2643,7 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { break; default : - break loop13; + break loop15; } } while (true); @@ -2438,8 +2679,8 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { public static final BitSet FOLLOW_1 = new BitSet(new long[]{0x0000000000000000L}); public static final BitSet FOLLOW_2 = new BitSet(new long[]{0x0000000000000002L}); public static final BitSet FOLLOW_3 = new BitSet(new long[]{0x0000000000004800L}); - public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000100000L}); - public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x0000000000100002L}); + public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000500000L}); + public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x0000000000500002L}); public static final BitSet FOLLOW_6 = new BitSet(new long[]{0x0000000000000010L}); public static final BitSet FOLLOW_7 = new BitSet(new long[]{0x0000000000001000L}); public static final BitSet FOLLOW_8 = new BitSet(new long[]{0x0000000000000020L}); @@ -2450,18 +2691,19 @@ public class InternalComputationParser extends AbstractInternalAntlrParser { public static final BitSet FOLLOW_13 = new BitSet(new long[]{0x0000000000040000L}); public static final BitSet FOLLOW_14 = new BitSet(new long[]{0x0000000000000030L}); public static final BitSet FOLLOW_15 = new BitSet(new long[]{0x0000000000080000L}); - public static final BitSet FOLLOW_16 = new BitSet(new long[]{0x0000000000600000L}); - public static final BitSet FOLLOW_17 = new BitSet(new long[]{0x0000000000680000L}); - public static final BitSet FOLLOW_18 = new BitSet(new long[]{0x0000000000800000L}); - public static final BitSet FOLLOW_19 = new BitSet(new long[]{0x000000000C000030L}); - public static final BitSet FOLLOW_20 = new BitSet(new long[]{0x0000000001000000L}); - public static final BitSet FOLLOW_21 = new BitSet(new long[]{0x0000000002000000L}); + public static final BitSet FOLLOW_16 = new BitSet(new long[]{0x0000000000280000L}); + public static final BitSet FOLLOW_17 = new BitSet(new long[]{0x0000000001800000L}); + public static final BitSet FOLLOW_18 = new BitSet(new long[]{0x0000000001880000L}); + public static final BitSet FOLLOW_19 = new BitSet(new long[]{0x0000000002000000L}); + public static final BitSet FOLLOW_20 = new BitSet(new long[]{0x0000000030000030L}); + public static final BitSet FOLLOW_21 = new BitSet(new long[]{0x0000000004000000L}); public static final BitSet FOLLOW_22 = new BitSet(new long[]{0x0000000008000000L}); - public static final BitSet FOLLOW_23 = new BitSet(new long[]{0x0000000010000000L}); - public static final BitSet FOLLOW_24 = new BitSet(new long[]{0x0000000030000000L}); - public static final BitSet FOLLOW_25 = new BitSet(new long[]{0x0000000040000000L}); - public static final BitSet FOLLOW_26 = new BitSet(new long[]{0x0000000020000000L}); - public static final BitSet FOLLOW_27 = new BitSet(new long[]{0x0000000040000002L}); - public static final BitSet FOLLOW_28 = new BitSet(new long[]{0x0000000000000012L}); + public static final BitSet FOLLOW_23 = new BitSet(new long[]{0x0000000020000000L}); + public static final BitSet FOLLOW_24 = new BitSet(new long[]{0x0000000000200000L}); + public static final BitSet FOLLOW_25 = new BitSet(new long[]{0x0000000040200000L}); + public static final BitSet FOLLOW_26 = new BitSet(new long[]{0x0000000080000000L}); + public static final BitSet FOLLOW_27 = new BitSet(new long[]{0x0000000040000000L}); + public static final BitSet FOLLOW_28 = new BitSet(new long[]{0x0000000080000002L}); + public static final BitSet FOLLOW_29 = new BitSet(new long[]{0x0000000000000012L}); } \ No newline at end of file diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/serializer/ComputationSemanticSequencer.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/serializer/ComputationSemanticSequencer.java index 1aa86f6d3a00a9aac2737b2666f5f751bacc5aa2..27797db5f4f292e744db2e2492c532ebf4390a68 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/serializer/ComputationSemanticSequencer.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/serializer/ComputationSemanticSequencer.java @@ -16,6 +16,7 @@ import org.eclipse.xtext.serializer.acceptor.SequenceFeeder; import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer; import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient; import typeexploration.computation.AddExpression; +import typeexploration.computation.BlockGroup; import typeexploration.computation.ComputationBlock; import typeexploration.computation.ComputationModel; import typeexploration.computation.ComputationPackage; @@ -43,6 +44,9 @@ public class ComputationSemanticSequencer extends AbstractDelegatingSemanticSequ case ComputationPackage.ADD_EXPRESSION: sequence_AddExpression(context, (AddExpression) semanticObject); return; + case ComputationPackage.BLOCK_GROUP: + sequence_BlockGroup(context, (BlockGroup) semanticObject); + return; case ComputationPackage.COMPUTATION_BLOCK: sequence_ComputationBlock(context, (ComputationBlock) semanticObject); return; @@ -98,6 +102,18 @@ public class ComputationSemanticSequencer extends AbstractDelegatingSemanticSequ } + /** + * Contexts: + * BlockGroup returns BlockGroup + * + * Constraint: + * (name=ID blocks+=[ComputationBlock|ID] blocks+=[ComputationBlock|ID]*) + */ + protected void sequence_BlockGroup(ISerializationContext context, BlockGroup semanticObject) { + genericSequencer.createSequence(context, semanticObject); + } + + /** * Contexts: * ComputationBlock returns ComputationBlock @@ -115,7 +131,7 @@ public class ComputationSemanticSequencer extends AbstractDelegatingSemanticSequ * ComputationModel returns ComputationModel * * Constraint: - * (parameters+=Parameter* targetDesign=HWTargetDesign blocks+=ComputationBlock+) + * (parameters+=Parameter* targetDesign=HWTargetDesign blockGroups+=BlockGroup* blocks+=ComputationBlock+) */ protected void sequence_ComputationModel(ISerializationContext context, ComputationModel semanticObject) { genericSequencer.createSequence(context, semanticObject); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/services/ComputationGrammarAccess.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/services/ComputationGrammarAccess.java index aab1313bfb8a4f6f28f2e5a4e9e8d42edf5cdee0..1eed1c137e4c266373cca85189d4bfaa9dcea50c 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/services/ComputationGrammarAccess.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src-gen/fr/irisa/cairn/gecos/typeexploration/services/ComputationGrammarAccess.java @@ -30,16 +30,19 @@ public class ComputationGrammarAccess extends AbstractGrammarElementFinder { private final RuleCall cParametersParameterParserRuleCall_0_0 = (RuleCall)cParametersAssignment_0.eContents().get(0); private final Assignment cTargetDesignAssignment_1 = (Assignment)cGroup.eContents().get(1); private final RuleCall cTargetDesignHWTargetDesignParserRuleCall_1_0 = (RuleCall)cTargetDesignAssignment_1.eContents().get(0); - private final Assignment cBlocksAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cBlocksComputationBlockParserRuleCall_2_0 = (RuleCall)cBlocksAssignment_2.eContents().get(0); + private final Assignment cBlockGroupsAssignment_2 = (Assignment)cGroup.eContents().get(2); + private final RuleCall cBlockGroupsBlockGroupParserRuleCall_2_0 = (RuleCall)cBlockGroupsAssignment_2.eContents().get(0); + private final Assignment cBlocksAssignment_3 = (Assignment)cGroup.eContents().get(3); + private final RuleCall cBlocksComputationBlockParserRuleCall_3_0 = (RuleCall)cBlocksAssignment_3.eContents().get(0); //ComputationModel: // parameters+=Parameter* // targetDesign=HWTargetDesign + // blockGroups+=BlockGroup* // blocks+=ComputationBlock+; @Override public ParserRule getRule() { return rule; } - //parameters+=Parameter* targetDesign=HWTargetDesign blocks+=ComputationBlock+ + //parameters+=Parameter* targetDesign=HWTargetDesign blockGroups+=BlockGroup* blocks+=ComputationBlock+ public Group getGroup() { return cGroup; } //parameters+=Parameter* @@ -54,11 +57,17 @@ public class ComputationGrammarAccess extends AbstractGrammarElementFinder { //HWTargetDesign public RuleCall getTargetDesignHWTargetDesignParserRuleCall_1_0() { return cTargetDesignHWTargetDesignParserRuleCall_1_0; } + //blockGroups+=BlockGroup* + public Assignment getBlockGroupsAssignment_2() { return cBlockGroupsAssignment_2; } + + //BlockGroup + public RuleCall getBlockGroupsBlockGroupParserRuleCall_2_0() { return cBlockGroupsBlockGroupParserRuleCall_2_0; } + //blocks+=ComputationBlock+ - public Assignment getBlocksAssignment_2() { return cBlocksAssignment_2; } + public Assignment getBlocksAssignment_3() { return cBlocksAssignment_3; } //ComputationBlock - public RuleCall getBlocksComputationBlockParserRuleCall_2_0() { return cBlocksComputationBlockParserRuleCall_2_0; } + public RuleCall getBlocksComputationBlockParserRuleCall_3_0() { return cBlocksComputationBlockParserRuleCall_3_0; } } public class ParameterElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "fr.irisa.cairn.gecos.typeexploration.Computation.Parameter"); @@ -175,6 +184,69 @@ public class ComputationGrammarAccess extends AbstractGrammarElementFinder { //'}' public Keyword getRightCurlyBracketKeyword_11() { return cRightCurlyBracketKeyword_11; } } + public class BlockGroupElements extends AbstractParserRuleElementFinder { + private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "fr.irisa.cairn.gecos.typeexploration.Computation.BlockGroup"); + private final Group cGroup = (Group)rule.eContents().get(1); + private final Keyword cGroupKeyword_0 = (Keyword)cGroup.eContents().get(0); + private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1); + private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0); + private final Keyword cLeftCurlyBracketKeyword_2 = (Keyword)cGroup.eContents().get(2); + private final Assignment cBlocksAssignment_3 = (Assignment)cGroup.eContents().get(3); + private final CrossReference cBlocksComputationBlockCrossReference_3_0 = (CrossReference)cBlocksAssignment_3.eContents().get(0); + private final RuleCall cBlocksComputationBlockIDTerminalRuleCall_3_0_1 = (RuleCall)cBlocksComputationBlockCrossReference_3_0.eContents().get(1); + private final Group cGroup_4 = (Group)cGroup.eContents().get(4); + private final Keyword cCommaKeyword_4_0 = (Keyword)cGroup_4.eContents().get(0); + private final Assignment cBlocksAssignment_4_1 = (Assignment)cGroup_4.eContents().get(1); + private final CrossReference cBlocksComputationBlockCrossReference_4_1_0 = (CrossReference)cBlocksAssignment_4_1.eContents().get(0); + private final RuleCall cBlocksComputationBlockIDTerminalRuleCall_4_1_0_1 = (RuleCall)cBlocksComputationBlockCrossReference_4_1_0.eContents().get(1); + private final Keyword cRightCurlyBracketKeyword_5 = (Keyword)cGroup.eContents().get(5); + + //BlockGroup: + // 'group' name=ID '{' blocks+=[ComputationBlock] (',' blocks+=[ComputationBlock])* '}'; + @Override public ParserRule getRule() { return rule; } + + //'group' name=ID '{' blocks+=[ComputationBlock] (',' blocks+=[ComputationBlock])* '}' + public Group getGroup() { return cGroup; } + + //'group' + public Keyword getGroupKeyword_0() { return cGroupKeyword_0; } + + //name=ID + public Assignment getNameAssignment_1() { return cNameAssignment_1; } + + //ID + public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; } + + //'{' + public Keyword getLeftCurlyBracketKeyword_2() { return cLeftCurlyBracketKeyword_2; } + + //blocks+=[ComputationBlock] + public Assignment getBlocksAssignment_3() { return cBlocksAssignment_3; } + + //[ComputationBlock] + public CrossReference getBlocksComputationBlockCrossReference_3_0() { return cBlocksComputationBlockCrossReference_3_0; } + + //ID + public RuleCall getBlocksComputationBlockIDTerminalRuleCall_3_0_1() { return cBlocksComputationBlockIDTerminalRuleCall_3_0_1; } + + //(',' blocks+=[ComputationBlock])* + public Group getGroup_4() { return cGroup_4; } + + //',' + public Keyword getCommaKeyword_4_0() { return cCommaKeyword_4_0; } + + //blocks+=[ComputationBlock] + public Assignment getBlocksAssignment_4_1() { return cBlocksAssignment_4_1; } + + //[ComputationBlock] + public CrossReference getBlocksComputationBlockCrossReference_4_1_0() { return cBlocksComputationBlockCrossReference_4_1_0; } + + //ID + public RuleCall getBlocksComputationBlockIDTerminalRuleCall_4_1_0_1() { return cBlocksComputationBlockIDTerminalRuleCall_4_1_0_1; } + + //'}' + public Keyword getRightCurlyBracketKeyword_5() { return cRightCurlyBracketKeyword_5; } + } public class ComputationBlockElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "fr.irisa.cairn.gecos.typeexploration.Computation.ComputationBlock"); private final Group cGroup = (Group)rule.eContents().get(1); @@ -578,6 +650,7 @@ public class ComputationGrammarAccess extends AbstractGrammarElementFinder { private final ComputationModelElements pComputationModel; private final ParameterElements pParameter; private final HWTargetDesignElements pHWTargetDesign; + private final BlockGroupElements pBlockGroup; private final ComputationBlockElements pComputationBlock; private final OPElements pOP; private final OperationElements pOperation; @@ -601,6 +674,7 @@ public class ComputationGrammarAccess extends AbstractGrammarElementFinder { this.pComputationModel = new ComputationModelElements(); this.pParameter = new ParameterElements(); this.pHWTargetDesign = new HWTargetDesignElements(); + this.pBlockGroup = new BlockGroupElements(); this.pComputationBlock = new ComputationBlockElements(); this.pOP = new OPElements(); this.pOperation = new OperationElements(); @@ -643,6 +717,7 @@ public class ComputationGrammarAccess extends AbstractGrammarElementFinder { //ComputationModel: // parameters+=Parameter* // targetDesign=HWTargetDesign + // blockGroups+=BlockGroup* // blocks+=ComputationBlock+; public ComputationModelElements getComputationModelAccess() { return pComputationModel; @@ -676,6 +751,16 @@ public class ComputationGrammarAccess extends AbstractGrammarElementFinder { return getHWTargetDesignAccess().getRule(); } + //BlockGroup: + // 'group' name=ID '{' blocks+=[ComputationBlock] (',' blocks+=[ComputationBlock])* '}'; + public BlockGroupElements getBlockGroupAccess() { + return pBlockGroup; + } + + public ParserRule getBlockGroupRule() { + return getBlockGroupAccess().getRule(); + } + //ComputationBlock: // 'block' name=ID '{' // operations+=Operation+ diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src/fr/irisa/cairn/gecos/typeexploration/Computation.xtext b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src/fr/irisa/cairn/gecos/typeexploration/Computation.xtext index 4a807707f59395990d6f8d52ddd0f0a3d605de65..15d534ac6c4710cbaa2a8d78ed17b462f400f605 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src/fr/irisa/cairn/gecos/typeexploration/Computation.xtext +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/src/fr/irisa/cairn/gecos/typeexploration/Computation.xtext @@ -1,13 +1,14 @@ // automatically generated by Xtext grammar fr.irisa.cairn.gecos.typeexploration.Computation with org.eclipse.xtext.common.Terminals -import "http://www.gecos.org/float2fix/computation" +import "http://www.gecos.org/float2fix/computation" import "http://www.eclipse.org/emf/2002/Ecore" as ecore ComputationModel: (parameters+=Parameter)* targetDesign=HWTargetDesign + blockGroups+=BlockGroup* blocks+=ComputationBlock+ ; @@ -23,6 +24,10 @@ HWTargetDesign: '}' ; +BlockGroup: + 'group' name=ID '{' blocks+=[ComputationBlock] (',' blocks+=[ComputationBlock])* '}' +; + ComputationBlock: 'block' name=ID '{' (operations+=Operation)+ diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/ComputationRuntimeModule.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/ComputationRuntimeModule.java index 366f6b2acff438e6ffc2cafd97a4ebb627ebecbc..eb603e8dfb0cb73e00f071be1094413466943b9a 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/ComputationRuntimeModule.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/ComputationRuntimeModule.java @@ -4,10 +4,12 @@ package fr.irisa.cairn.gecos.typeexploration; import fr.irisa.cairn.gecos.typeexploration.AbstractComputationRuntimeModule; +import javax.annotation.Generated; /** * Use this class to register components to be used at runtime / without the Equinox extension registry. */ @SuppressWarnings("all") +@Generated(value = "org.eclipse.xtend.core.compiler.XtendGenerator", date = "2019-04-08T14:12+0200") public class ComputationRuntimeModule extends AbstractComputationRuntimeModule { } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/ComputationStandaloneSetup.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/ComputationStandaloneSetup.java index 34a5fb7c07a9c439e0bded64b6cf44b76a0591e4..9d7589606cbd81ba2ed53ad1213d9a85aab4b1c5 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/ComputationStandaloneSetup.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/ComputationStandaloneSetup.java @@ -4,11 +4,13 @@ package fr.irisa.cairn.gecos.typeexploration; import fr.irisa.cairn.gecos.typeexploration.ComputationStandaloneSetupGenerated; +import javax.annotation.Generated; /** * Initialization support for running Xtext languages without Equinox extension registry. */ @SuppressWarnings("all") +@Generated(value = "org.eclipse.xtend.core.compiler.XtendGenerator", date = "2019-04-08T14:12+0200") public class ComputationStandaloneSetup extends ComputationStandaloneSetupGenerated { public static void doSetup() { new ComputationStandaloneSetup().createInjectorAndDoEMFRegistration(); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/generator/ComputationGenerator.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/generator/ComputationGenerator.java index c65c0947f0b56aab5610f239903964ce894dd9b7..8c847ff9f5206ff719facc944b43680ec063e6dd 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/generator/ComputationGenerator.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/generator/ComputationGenerator.java @@ -3,6 +3,7 @@ */ package fr.irisa.cairn.gecos.typeexploration.generator; +import javax.annotation.Generated; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.xtext.generator.AbstractGenerator; import org.eclipse.xtext.generator.IFileSystemAccess2; @@ -14,6 +15,7 @@ import org.eclipse.xtext.generator.IGeneratorContext; * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation */ @SuppressWarnings("all") +@Generated(value = "org.eclipse.xtend.core.compiler.XtendGenerator", date = "2019-04-08T14:12+0200") public class ComputationGenerator extends AbstractGenerator { @Override public void doGenerate(final Resource resource, final IFileSystemAccess2 fsa, final IGeneratorContext context) { diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/scoping/ComputationScopeProvider.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/scoping/ComputationScopeProvider.java index cc100ddfeac25cd1c987bf1c0c1746cb7c5a372e..2a59094a95df11a1a8bf7d71b477cb4f619cf404 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/scoping/ComputationScopeProvider.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/scoping/ComputationScopeProvider.java @@ -4,6 +4,7 @@ package fr.irisa.cairn.gecos.typeexploration.scoping; import fr.irisa.cairn.gecos.typeexploration.scoping.AbstractComputationScopeProvider; +import javax.annotation.Generated; /** * This class contains custom scoping description. @@ -12,5 +13,6 @@ import fr.irisa.cairn.gecos.typeexploration.scoping.AbstractComputationScopeProv * on how and when to use it. */ @SuppressWarnings("all") +@Generated(value = "org.eclipse.xtend.core.compiler.XtendGenerator", date = "2019-04-08T14:12+0200") public class ComputationScopeProvider extends AbstractComputationScopeProvider { } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/validation/ComputationValidator.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/validation/ComputationValidator.java index e8f6c31e2d8f79dad67385159fa5352316891398..1525fc8cf8b8f9dd519d8065c85a83ae5d9200d7 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/validation/ComputationValidator.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation.xtext/xtend-gen/fr/irisa/cairn/gecos/typeexploration/validation/ComputationValidator.java @@ -4,6 +4,7 @@ package fr.irisa.cairn.gecos.typeexploration.validation; import fr.irisa.cairn.gecos.typeexploration.validation.AbstractComputationValidator; +import javax.annotation.Generated; /** * This class contains custom validation rules. @@ -11,5 +12,6 @@ import fr.irisa.cairn.gecos.typeexploration.validation.AbstractComputationValida * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation */ @SuppressWarnings("all") +@Generated(value = "org.eclipse.xtend.core.compiler.XtendGenerator", date = "2019-04-08T14:12+0200") public class ComputationValidator extends AbstractComputationValidator { } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/.classpath b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/.classpath index 557ba049940dfb174d106f1eb2fd419c74a242cf..c06be194ff0bbbcd65d554bf021ab635a3b7a3e0 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/.classpath +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/.classpath @@ -2,8 +2,8 @@ <classpath> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src-gen"/> <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="model"/> + <classpathentry kind="src" path="src-gen"/> + <classpathentry kind="src" path="model/"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/build.properties b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/build.properties index fef376ee8d7541c88d4be62c5ad4d50ef23c78b0..c4d6591031aa4f856ee692a1bfbc53a88ece9bb3 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/build.properties +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/build.properties @@ -3,10 +3,11 @@ bin.includes = .,\ model/,\ META-INF/,\ + resources/,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src-gen/,\ - resources/,\ - src/ +source.. = src/,\ + model/,\ + src-gen/ output.. = bin/ diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/model/Computation.xcore b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/model/Computation.xcore index 150a68ebc636871f4d251ab54678b733b4c24e26..0007bee92885094f3dfaab7d0c4ccdb92ae7bcc1 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/model/Computation.xcore +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/model/Computation.xcore @@ -10,6 +10,7 @@ enum HWOpType { class ComputationModel { contains Parameter[] parameters contains HWTargetDesign targetDesign + contains BlockGroup[] blockGroups contains ComputationBlock[] blocks } @@ -30,6 +31,11 @@ class HWTargetDesign { } } +class BlockGroup { + id String name + refers ComputationBlock[] blocks +} + class ComputationBlock { id String name contains Operation[] operations diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/pom.xml b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..5800271e737a7fad06fdf6e91591041466c3c3d8 --- /dev/null +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/pom.xml @@ -0,0 +1,33 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <artifactId>fr.irisa.cairn.gecos.typeexploration.computation</artifactId> + <packaging>eclipse-plugin</packaging> + <version>1.0.0-SNAPSHOT</version> + + <parent> + <groupId>fr.irisa.cairn.gecos.float2fix</groupId> + <artifactId>fr.irisa.cairn.gecos.float2fix.bundles</artifactId> + <version>1.0.0</version> + <relativePath>..</relativePath> + </parent> + + <build> + <plugins> + <plugin> + <groupId>org.eclipse.xtext</groupId> + <artifactId>xtext-maven-plugin</artifactId> + </plugin> + <!-- + Enable xtend maven plugin on XCore projects in order to + automatically apply XText nature on the eclipse project + via M2E plugins; + --> + <plugin> + <groupId>org.eclipse.xtend</groupId> + <artifactId>xtend-maven-plugin</artifactId> + </plugin> + </plugins> + </build> +</project> diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/BlockGroup.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/BlockGroup.java new file mode 100644 index 0000000000000000000000000000000000000000..a84c42144ee640decf9efab20cd3013b1aacd212 --- /dev/null +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/BlockGroup.java @@ -0,0 +1,69 @@ +/** + */ +package typeexploration.computation; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Block Group</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link typeexploration.computation.BlockGroup#getName <em>Name</em>}</li> + * <li>{@link typeexploration.computation.BlockGroup#getBlocks <em>Blocks</em>}</li> + * </ul> + * + * @see typeexploration.computation.ComputationPackage#getBlockGroup() + * @model + * @generated + */ +public interface BlockGroup extends EObject { + /** + * Returns the value of the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Name</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Name</em>' attribute. + * @see #setName(String) + * @see typeexploration.computation.ComputationPackage#getBlockGroup_Name() + * @model unique="false" id="true" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link typeexploration.computation.BlockGroup#getName <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Name</em>' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the '<em><b>Blocks</b></em>' reference list. + * The list contents are of type {@link typeexploration.computation.ComputationBlock}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Blocks</em>' reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Blocks</em>' reference list. + * @see typeexploration.computation.ComputationPackage#getBlockGroup_Blocks() + * @model + * @generated + */ + EList<ComputationBlock> getBlocks(); + +} // BlockGroup diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/ComputationFactory.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/ComputationFactory.java index f2bfef725fb61f96e60506b869b2f24fa739c87e..e455bcf8390f7e5e4065b8098e82e80dc5f6c83d 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/ComputationFactory.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/ComputationFactory.java @@ -48,6 +48,15 @@ public interface ComputationFactory extends EFactory { */ HWTargetDesign createHWTargetDesign(); + /** + * Returns a new object of class '<em>Block Group</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Block Group</em>'. + * @generated + */ + BlockGroup createBlockGroup(); + /** * Returns a new object of class '<em>Block</em>'. * <!-- begin-user-doc --> diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/ComputationModel.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/ComputationModel.java index 5d95d0b543bdc1da57f052321c3d39d4eb7766e5..6bd7c6d78063c10647ff1ae388b3ef4ece132135 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/ComputationModel.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/ComputationModel.java @@ -17,6 +17,7 @@ import org.eclipse.emf.ecore.EObject; * <ul> * <li>{@link typeexploration.computation.ComputationModel#getParameters <em>Parameters</em>}</li> * <li>{@link typeexploration.computation.ComputationModel#getTargetDesign <em>Target Design</em>}</li> + * <li>{@link typeexploration.computation.ComputationModel#getBlockGroups <em>Block Groups</em>}</li> * <li>{@link typeexploration.computation.ComputationModel#getBlocks <em>Blocks</em>}</li> * </ul> * @@ -67,6 +68,22 @@ public interface ComputationModel extends EObject { */ void setTargetDesign(HWTargetDesign value); + /** + * Returns the value of the '<em><b>Block Groups</b></em>' containment reference list. + * The list contents are of type {@link typeexploration.computation.BlockGroup}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Block Groups</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Block Groups</em>' containment reference list. + * @see typeexploration.computation.ComputationPackage#getComputationModel_BlockGroups() + * @model containment="true" + * @generated + */ + EList<BlockGroup> getBlockGroups(); + /** * Returns the value of the '<em><b>Blocks</b></em>' containment reference list. * The list contents are of type {@link typeexploration.computation.ComputationBlock}. diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/ComputationPackage.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/ComputationPackage.java index fd58e4fa267906f8039d7d810179571ec1022a7f..c5f53ff28be46e837c19b1dc58245ea8bcc91ca8 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/ComputationPackage.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/ComputationPackage.java @@ -87,6 +87,15 @@ public interface ComputationPackage extends EPackage { */ int COMPUTATION_MODEL__TARGET_DESIGN = 1; + /** + * The feature id for the '<em><b>Block Groups</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int COMPUTATION_MODEL__BLOCK_GROUPS = 2; + /** * The feature id for the '<em><b>Blocks</b></em>' containment reference list. * <!-- begin-user-doc --> @@ -94,7 +103,7 @@ public interface ComputationPackage extends EPackage { * @generated * @ordered */ - int COMPUTATION_MODEL__BLOCKS = 2; + int COMPUTATION_MODEL__BLOCKS = 3; /** * The number of structural features of the '<em>Model</em>' class. @@ -103,7 +112,7 @@ public interface ComputationPackage extends EPackage { * @generated * @ordered */ - int COMPUTATION_MODEL_FEATURE_COUNT = 3; + int COMPUTATION_MODEL_FEATURE_COUNT = 4; /** * The number of operations of the '<em>Model</em>' class. @@ -224,6 +233,52 @@ public interface ComputationPackage extends EPackage { */ int HW_TARGET_DESIGN_OPERATION_COUNT = 0; + /** + * The meta object id for the '{@link typeexploration.computation.impl.BlockGroupImpl <em>Block Group</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see typeexploration.computation.impl.BlockGroupImpl + * @see typeexploration.computation.impl.ComputationPackageImpl#getBlockGroup() + * @generated + */ + int BLOCK_GROUP = 3; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BLOCK_GROUP__NAME = 0; + + /** + * The feature id for the '<em><b>Blocks</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BLOCK_GROUP__BLOCKS = 1; + + /** + * The number of structural features of the '<em>Block Group</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BLOCK_GROUP_FEATURE_COUNT = 2; + + /** + * The number of operations of the '<em>Block Group</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BLOCK_GROUP_OPERATION_COUNT = 0; + /** * The meta object id for the '{@link typeexploration.computation.impl.ComputationBlockImpl <em>Block</em>}' class. * <!-- begin-user-doc --> @@ -232,7 +287,7 @@ public interface ComputationPackage extends EPackage { * @see typeexploration.computation.impl.ComputationPackageImpl#getComputationBlock() * @generated */ - int COMPUTATION_BLOCK = 3; + int COMPUTATION_BLOCK = 4; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -278,7 +333,7 @@ public interface ComputationPackage extends EPackage { * @see typeexploration.computation.impl.ComputationPackageImpl#getOperation() * @generated */ - int OPERATION = 4; + int OPERATION = 5; /** * The feature id for the '<em><b>Op Type</b></em>' attribute. @@ -351,7 +406,7 @@ public interface ComputationPackage extends EPackage { * @see typeexploration.computation.impl.ComputationPackageImpl#getOperandExpression() * @generated */ - int OPERAND_EXPRESSION = 5; + int OPERAND_EXPRESSION = 6; /** * The number of structural features of the '<em>Operand Expression</em>' class. @@ -379,7 +434,7 @@ public interface ComputationPackage extends EPackage { * @see typeexploration.computation.impl.ComputationPackageImpl#getMaxExpression() * @generated */ - int MAX_EXPRESSION = 6; + int MAX_EXPRESSION = 7; /** * The feature id for the '<em><b>Exprs</b></em>' containment reference list. @@ -416,7 +471,7 @@ public interface ComputationPackage extends EPackage { * @see typeexploration.computation.impl.ComputationPackageImpl#getAddExpression() * @generated */ - int ADD_EXPRESSION = 7; + int ADD_EXPRESSION = 8; /** * The feature id for the '<em><b>Op1</b></em>' containment reference. @@ -462,7 +517,7 @@ public interface ComputationPackage extends EPackage { * @see typeexploration.computation.impl.ComputationPackageImpl#getOperandTerm() * @generated */ - int OPERAND_TERM = 8; + int OPERAND_TERM = 9; /** * The feature id for the '<em><b>Coef</b></em>' attribute. @@ -508,7 +563,7 @@ public interface ComputationPackage extends EPackage { * @see typeexploration.computation.impl.ComputationPackageImpl#getSizeExpression() * @generated */ - int SIZE_EXPRESSION = 9; + int SIZE_EXPRESSION = 10; /** * The number of structural features of the '<em>Size Expression</em>' class. @@ -545,7 +600,7 @@ public interface ComputationPackage extends EPackage { * @see typeexploration.computation.impl.ComputationPackageImpl#getSummationExpression() * @generated */ - int SUMMATION_EXPRESSION = 10; + int SUMMATION_EXPRESSION = 11; /** * The feature id for the '<em><b>Constant</b></em>' attribute. @@ -600,7 +655,7 @@ public interface ComputationPackage extends EPackage { * @see typeexploration.computation.impl.ComputationPackageImpl#getProductExpression() * @generated */ - int PRODUCT_EXPRESSION = 11; + int PRODUCT_EXPRESSION = 12; /** * The feature id for the '<em><b>Constant</b></em>' attribute. @@ -655,7 +710,7 @@ public interface ComputationPackage extends EPackage { * @see typeexploration.computation.impl.ComputationPackageImpl#getHWOpType() * @generated */ - int HW_OP_TYPE = 12; + int HW_OP_TYPE = 13; /** @@ -690,6 +745,17 @@ public interface ComputationPackage extends EPackage { */ EReference getComputationModel_TargetDesign(); + /** + * Returns the meta object for the containment reference list '{@link typeexploration.computation.ComputationModel#getBlockGroups <em>Block Groups</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Block Groups</em>'. + * @see typeexploration.computation.ComputationModel#getBlockGroups() + * @see #getComputationModel() + * @generated + */ + EReference getComputationModel_BlockGroups(); + /** * Returns the meta object for the containment reference list '{@link typeexploration.computation.ComputationModel#getBlocks <em>Blocks</em>}'. * <!-- begin-user-doc --> @@ -787,6 +853,38 @@ public interface ComputationPackage extends EPackage { */ EAttribute getHWTargetDesign_TotalLatency(); + /** + * Returns the meta object for class '{@link typeexploration.computation.BlockGroup <em>Block Group</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Block Group</em>'. + * @see typeexploration.computation.BlockGroup + * @generated + */ + EClass getBlockGroup(); + + /** + * Returns the meta object for the attribute '{@link typeexploration.computation.BlockGroup#getName <em>Name</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Name</em>'. + * @see typeexploration.computation.BlockGroup#getName() + * @see #getBlockGroup() + * @generated + */ + EAttribute getBlockGroup_Name(); + + /** + * Returns the meta object for the reference list '{@link typeexploration.computation.BlockGroup#getBlocks <em>Blocks</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>Blocks</em>'. + * @see typeexploration.computation.BlockGroup#getBlocks() + * @see #getBlockGroup() + * @generated + */ + EReference getBlockGroup_Blocks(); + /** * Returns the meta object for class '{@link typeexploration.computation.ComputationBlock <em>Block</em>}'. * <!-- begin-user-doc --> @@ -1142,6 +1240,14 @@ public interface ComputationPackage extends EPackage { */ EReference COMPUTATION_MODEL__TARGET_DESIGN = eINSTANCE.getComputationModel_TargetDesign(); + /** + * The meta object literal for the '<em><b>Block Groups</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference COMPUTATION_MODEL__BLOCK_GROUPS = eINSTANCE.getComputationModel_BlockGroups(); + /** * The meta object literal for the '<em><b>Blocks</b></em>' containment reference list feature. * <!-- begin-user-doc --> @@ -1218,6 +1324,32 @@ public interface ComputationPackage extends EPackage { */ EAttribute HW_TARGET_DESIGN__TOTAL_LATENCY = eINSTANCE.getHWTargetDesign_TotalLatency(); + /** + * The meta object literal for the '{@link typeexploration.computation.impl.BlockGroupImpl <em>Block Group</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see typeexploration.computation.impl.BlockGroupImpl + * @see typeexploration.computation.impl.ComputationPackageImpl#getBlockGroup() + * @generated + */ + EClass BLOCK_GROUP = eINSTANCE.getBlockGroup(); + + /** + * The meta object literal for the '<em><b>Name</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute BLOCK_GROUP__NAME = eINSTANCE.getBlockGroup_Name(); + + /** + * The meta object literal for the '<em><b>Blocks</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference BLOCK_GROUP__BLOCKS = eINSTANCE.getBlockGroup_Blocks(); + /** * The meta object literal for the '{@link typeexploration.computation.impl.ComputationBlockImpl <em>Block</em>}' class. * <!-- begin-user-doc --> diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/BlockGroupImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/BlockGroupImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..d036b5b9d5b55400b53cae243d1320e8113a1bf0 --- /dev/null +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/BlockGroupImpl.java @@ -0,0 +1,205 @@ +/** + */ +package typeexploration.computation.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +import typeexploration.computation.BlockGroup; +import typeexploration.computation.ComputationBlock; +import typeexploration.computation.ComputationPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Block Group</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link typeexploration.computation.impl.BlockGroupImpl#getName <em>Name</em>}</li> + * <li>{@link typeexploration.computation.impl.BlockGroupImpl#getBlocks <em>Blocks</em>}</li> + * </ul> + * + * @generated + */ +public class BlockGroupImpl extends MinimalEObjectImpl.Container implements BlockGroup { + /** + * The default value of the '{@link #getName() <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getBlocks() <em>Blocks</em>}' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getBlocks() + * @generated + * @ordered + */ + protected EList<ComputationBlock> blocks; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected BlockGroupImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return ComputationPackage.Literals.BLOCK_GROUP; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getName() { + return name; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ComputationPackage.BLOCK_GROUP__NAME, oldName, name)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<ComputationBlock> getBlocks() { + if (blocks == null) { + blocks = new EObjectResolvingEList<ComputationBlock>(ComputationBlock.class, this, ComputationPackage.BLOCK_GROUP__BLOCKS); + } + return blocks; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ComputationPackage.BLOCK_GROUP__NAME: + return getName(); + case ComputationPackage.BLOCK_GROUP__BLOCKS: + return getBlocks(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ComputationPackage.BLOCK_GROUP__NAME: + setName((String)newValue); + return; + case ComputationPackage.BLOCK_GROUP__BLOCKS: + getBlocks().clear(); + getBlocks().addAll((Collection<? extends ComputationBlock>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ComputationPackage.BLOCK_GROUP__NAME: + setName(NAME_EDEFAULT); + return; + case ComputationPackage.BLOCK_GROUP__BLOCKS: + getBlocks().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ComputationPackage.BLOCK_GROUP__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case ComputationPackage.BLOCK_GROUP__BLOCKS: + return blocks != null && !blocks.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //BlockGroupImpl diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationBlockImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationBlockImpl.java index 49c005d84997d898bec3c6c7d3ea09f7093f3e48..fcdbaa93c6f70ea9639d8b983f4816a1d2ba36b7 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationBlockImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationBlockImpl.java @@ -212,7 +212,7 @@ public class ComputationBlockImpl extends MinimalEObjectImpl.Container implement public String toString() { if (eIsProxy()) return super.toString(); - StringBuilder result = new StringBuilder(super.toString()); + StringBuffer result = new StringBuffer(super.toString()); result.append(" (name: "); result.append(name); result.append(')'); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationFactoryImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationFactoryImpl.java index a4be9799f6e53e40c91fd59f9937f08e3ad39c2c..5deccd25381361451c4c1d20c22128b4319ea2be 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationFactoryImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationFactoryImpl.java @@ -60,6 +60,7 @@ public class ComputationFactoryImpl extends EFactoryImpl implements ComputationF case ComputationPackage.COMPUTATION_MODEL: return createComputationModel(); case ComputationPackage.PARAMETER: return createParameter(); case ComputationPackage.HW_TARGET_DESIGN: return createHWTargetDesign(); + case ComputationPackage.BLOCK_GROUP: return createBlockGroup(); case ComputationPackage.COMPUTATION_BLOCK: return createComputationBlock(); case ComputationPackage.OPERATION: return createOperation(); case ComputationPackage.MAX_EXPRESSION: return createMaxExpression(); @@ -132,6 +133,16 @@ public class ComputationFactoryImpl extends EFactoryImpl implements ComputationF return hwTargetDesign; } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BlockGroup createBlockGroup() { + BlockGroupImpl blockGroup = new BlockGroupImpl(); + return blockGroup; + } + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationModelImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationModelImpl.java index 1b2853fa2ff4ccd9194c9cf74c880dc2d719aebe..5362fd0fccf861c76180805ad0720b9b5d804539 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationModelImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationModelImpl.java @@ -18,6 +18,7 @@ import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import typeexploration.computation.BlockGroup; import typeexploration.computation.ComputationBlock; import typeexploration.computation.ComputationModel; import typeexploration.computation.ComputationPackage; @@ -34,6 +35,7 @@ import typeexploration.computation.Parameter; * <ul> * <li>{@link typeexploration.computation.impl.ComputationModelImpl#getParameters <em>Parameters</em>}</li> * <li>{@link typeexploration.computation.impl.ComputationModelImpl#getTargetDesign <em>Target Design</em>}</li> + * <li>{@link typeexploration.computation.impl.ComputationModelImpl#getBlockGroups <em>Block Groups</em>}</li> * <li>{@link typeexploration.computation.impl.ComputationModelImpl#getBlocks <em>Blocks</em>}</li> * </ul> * @@ -60,6 +62,16 @@ public class ComputationModelImpl extends MinimalEObjectImpl.Container implement */ protected HWTargetDesign targetDesign; + /** + * The cached value of the '{@link #getBlockGroups() <em>Block Groups</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getBlockGroups() + * @generated + * @ordered + */ + protected EList<BlockGroup> blockGroups; + /** * The cached value of the '{@link #getBlocks() <em>Blocks</em>}' containment reference list. * <!-- begin-user-doc --> @@ -144,6 +156,18 @@ public class ComputationModelImpl extends MinimalEObjectImpl.Container implement eNotify(new ENotificationImpl(this, Notification.SET, ComputationPackage.COMPUTATION_MODEL__TARGET_DESIGN, newTargetDesign, newTargetDesign)); } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<BlockGroup> getBlockGroups() { + if (blockGroups == null) { + blockGroups = new EObjectContainmentEList<BlockGroup>(BlockGroup.class, this, ComputationPackage.COMPUTATION_MODEL__BLOCK_GROUPS); + } + return blockGroups; + } + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -168,6 +192,8 @@ public class ComputationModelImpl extends MinimalEObjectImpl.Container implement return ((InternalEList<?>)getParameters()).basicRemove(otherEnd, msgs); case ComputationPackage.COMPUTATION_MODEL__TARGET_DESIGN: return basicSetTargetDesign(null, msgs); + case ComputationPackage.COMPUTATION_MODEL__BLOCK_GROUPS: + return ((InternalEList<?>)getBlockGroups()).basicRemove(otherEnd, msgs); case ComputationPackage.COMPUTATION_MODEL__BLOCKS: return ((InternalEList<?>)getBlocks()).basicRemove(otherEnd, msgs); } @@ -186,6 +212,8 @@ public class ComputationModelImpl extends MinimalEObjectImpl.Container implement return getParameters(); case ComputationPackage.COMPUTATION_MODEL__TARGET_DESIGN: return getTargetDesign(); + case ComputationPackage.COMPUTATION_MODEL__BLOCK_GROUPS: + return getBlockGroups(); case ComputationPackage.COMPUTATION_MODEL__BLOCKS: return getBlocks(); } @@ -208,6 +236,10 @@ public class ComputationModelImpl extends MinimalEObjectImpl.Container implement case ComputationPackage.COMPUTATION_MODEL__TARGET_DESIGN: setTargetDesign((HWTargetDesign)newValue); return; + case ComputationPackage.COMPUTATION_MODEL__BLOCK_GROUPS: + getBlockGroups().clear(); + getBlockGroups().addAll((Collection<? extends BlockGroup>)newValue); + return; case ComputationPackage.COMPUTATION_MODEL__BLOCKS: getBlocks().clear(); getBlocks().addAll((Collection<? extends ComputationBlock>)newValue); @@ -230,6 +262,9 @@ public class ComputationModelImpl extends MinimalEObjectImpl.Container implement case ComputationPackage.COMPUTATION_MODEL__TARGET_DESIGN: setTargetDesign((HWTargetDesign)null); return; + case ComputationPackage.COMPUTATION_MODEL__BLOCK_GROUPS: + getBlockGroups().clear(); + return; case ComputationPackage.COMPUTATION_MODEL__BLOCKS: getBlocks().clear(); return; @@ -249,6 +284,8 @@ public class ComputationModelImpl extends MinimalEObjectImpl.Container implement return parameters != null && !parameters.isEmpty(); case ComputationPackage.COMPUTATION_MODEL__TARGET_DESIGN: return targetDesign != null; + case ComputationPackage.COMPUTATION_MODEL__BLOCK_GROUPS: + return blockGroups != null && !blockGroups.isEmpty(); case ComputationPackage.COMPUTATION_MODEL__BLOCKS: return blocks != null && !blocks.isEmpty(); } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationPackageImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationPackageImpl.java index 781fb3bc3440d1f487b5ac688a3d6bd641b764ec..21ae2d72e677bf067744009ea50079551fe1f301 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationPackageImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ComputationPackageImpl.java @@ -13,6 +13,7 @@ import org.eclipse.emf.ecore.EcorePackage; import org.eclipse.emf.ecore.impl.EPackageImpl; import typeexploration.computation.AddExpression; +import typeexploration.computation.BlockGroup; import typeexploration.computation.ComputationBlock; import typeexploration.computation.ComputationFactory; import typeexploration.computation.ComputationModel; @@ -56,6 +57,13 @@ public class ComputationPackageImpl extends EPackageImpl implements ComputationP */ private EClass hwTargetDesignEClass = null; + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass blockGroupEClass = null; + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -154,7 +162,7 @@ public class ComputationPackageImpl extends EPackageImpl implements ComputationP /** * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. - * + * * <p>This method is used to initialize {@link ComputationPackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * <!-- begin-user-doc --> @@ -168,8 +176,7 @@ public class ComputationPackageImpl extends EPackageImpl implements ComputationP if (isInited) return (ComputationPackage)EPackage.Registry.INSTANCE.getEPackage(ComputationPackage.eNS_URI); // Obtain or create and register package - Object registeredComputationPackage = EPackage.Registry.INSTANCE.get(eNS_URI); - ComputationPackageImpl theComputationPackage = registeredComputationPackage instanceof ComputationPackageImpl ? (ComputationPackageImpl)registeredComputationPackage : new ComputationPackageImpl(); + ComputationPackageImpl theComputationPackage = (ComputationPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ComputationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ComputationPackageImpl()); isInited = true; @@ -185,6 +192,7 @@ public class ComputationPackageImpl extends EPackageImpl implements ComputationP // Mark meta-data to indicate it can't be changed theComputationPackage.freeze(); + // Update the registry and return the package EPackage.Registry.INSTANCE.put(ComputationPackage.eNS_URI, theComputationPackage); return theComputationPackage; @@ -222,10 +230,19 @@ public class ComputationPackageImpl extends EPackageImpl implements ComputationP * <!-- end-user-doc --> * @generated */ - public EReference getComputationModel_Blocks() { + public EReference getComputationModel_BlockGroups() { return (EReference)computationModelEClass.getEStructuralFeatures().get(2); } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getComputationModel_Blocks() { + return (EReference)computationModelEClass.getEStructuralFeatures().get(3); + } + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -298,6 +315,33 @@ public class ComputationPackageImpl extends EPackageImpl implements ComputationP return (EAttribute)hwTargetDesignEClass.getEStructuralFeatures().get(3); } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getBlockGroup() { + return blockGroupEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getBlockGroup_Name() { + return (EAttribute)blockGroupEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getBlockGroup_Blocks() { + return (EReference)blockGroupEClass.getEStructuralFeatures().get(1); + } + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -590,6 +634,7 @@ public class ComputationPackageImpl extends EPackageImpl implements ComputationP computationModelEClass = createEClass(COMPUTATION_MODEL); createEReference(computationModelEClass, COMPUTATION_MODEL__PARAMETERS); createEReference(computationModelEClass, COMPUTATION_MODEL__TARGET_DESIGN); + createEReference(computationModelEClass, COMPUTATION_MODEL__BLOCK_GROUPS); createEReference(computationModelEClass, COMPUTATION_MODEL__BLOCKS); parameterEClass = createEClass(PARAMETER); @@ -602,6 +647,10 @@ public class ComputationPackageImpl extends EPackageImpl implements ComputationP createEReference(hwTargetDesignEClass, HW_TARGET_DESIGN__PROBLEM_SIZE_EXPR); createEAttribute(hwTargetDesignEClass, HW_TARGET_DESIGN__TOTAL_LATENCY); + blockGroupEClass = createEClass(BLOCK_GROUP); + createEAttribute(blockGroupEClass, BLOCK_GROUP__NAME); + createEReference(blockGroupEClass, BLOCK_GROUP__BLOCKS); + computationBlockEClass = createEClass(COMPUTATION_BLOCK); createEAttribute(computationBlockEClass, COMPUTATION_BLOCK__NAME); createEReference(computationBlockEClass, COMPUTATION_BLOCK__OPERATIONS); @@ -684,6 +733,7 @@ public class ComputationPackageImpl extends EPackageImpl implements ComputationP initEClass(computationModelEClass, ComputationModel.class, "ComputationModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getComputationModel_Parameters(), this.getParameter(), null, "parameters", null, 0, -1, ComputationModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getComputationModel_TargetDesign(), this.getHWTargetDesign(), null, "targetDesign", null, 0, 1, ComputationModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getComputationModel_BlockGroups(), this.getBlockGroup(), null, "blockGroups", null, 0, -1, ComputationModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getComputationModel_Blocks(), this.getComputationBlock(), null, "blocks", null, 0, -1, ComputationModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(parameterEClass, Parameter.class, "Parameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -696,6 +746,10 @@ public class ComputationPackageImpl extends EPackageImpl implements ComputationP initEReference(getHWTargetDesign_ProblemSizeExpr(), this.getSizeExpression(), null, "problemSizeExpr", null, 0, 1, HWTargetDesign.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getHWTargetDesign_TotalLatency(), theEcorePackage.getEDouble(), "totalLatency", null, 0, 1, HWTargetDesign.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEClass(blockGroupEClass, BlockGroup.class, "BlockGroup", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getBlockGroup_Name(), theEcorePackage.getEString(), "name", null, 0, 1, BlockGroup.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getBlockGroup_Blocks(), this.getComputationBlock(), null, "blocks", null, 0, -1, BlockGroup.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(computationBlockEClass, ComputationBlock.class, "ComputationBlock", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getComputationBlock_Name(), theEcorePackage.getEString(), "name", null, 0, 1, ComputationBlock.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getComputationBlock_Operations(), this.getOperation(), null, "operations", null, 0, -1, ComputationBlock.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/HWTargetDesignImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/HWTargetDesignImpl.java index 3f4dcfa9b3ec03f60e188a6f57bb8a28dbaac64e..c4b5a13535b47d053fa16efa8882998f23383f6a 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/HWTargetDesignImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/HWTargetDesignImpl.java @@ -319,7 +319,7 @@ public class HWTargetDesignImpl extends MinimalEObjectImpl.Container implements public String toString() { if (eIsProxy()) return super.toString(); - StringBuilder result = new StringBuilder(super.toString()); + StringBuffer result = new StringBuffer(super.toString()); result.append(" (frequency: "); result.append(frequency); result.append(", outputsPerCycle: "); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/OperandTermImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/OperandTermImpl.java index 90f8dc705859cc2ecd3236b278bceca4b487a1c7..6ff354e85be8dee27fe5cd9c488a2323c3440623 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/OperandTermImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/OperandTermImpl.java @@ -204,7 +204,7 @@ public class OperandTermImpl extends OperandExpressionImpl implements OperandTer public String toString() { if (eIsProxy()) return super.toString(); - StringBuilder result = new StringBuilder(super.toString()); + StringBuffer result = new StringBuffer(super.toString()); result.append(" (coef: "); result.append(coef); result.append(", name: "); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/OperationImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/OperationImpl.java index 892d7fb4a62363e22af50ca4b1540a32de6c9c57..54b423f7b0be773e81c93afe7e4decfd594d5025 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/OperationImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/OperationImpl.java @@ -434,7 +434,7 @@ public class OperationImpl extends MinimalEObjectImpl.Container implements Opera public String toString() { if (eIsProxy()) return super.toString(); - StringBuilder result = new StringBuilder(super.toString()); + StringBuffer result = new StringBuffer(super.toString()); result.append(" (opType: "); result.append(opType); result.append(')'); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ParameterImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ParameterImpl.java index 3bd2b3c35ba63cc669f27c9aa823001d399ace8d..9c4b72fa09066f9de3439d38d873c9f8cdf5a65d 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ParameterImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ParameterImpl.java @@ -205,7 +205,7 @@ public class ParameterImpl extends MinimalEObjectImpl.Container implements Param public String toString() { if (eIsProxy()) return super.toString(); - StringBuilder result = new StringBuilder(super.toString()); + StringBuffer result = new StringBuffer(super.toString()); result.append(" (name: "); result.append(name); result.append(", value: "); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ProductExpressionImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ProductExpressionImpl.java index d4c3220622d7a1ce3991b46b6c8a0b5a7a8c8778..d784d358f982cb127191dc9884609dbf8f243125 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ProductExpressionImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/ProductExpressionImpl.java @@ -251,7 +251,7 @@ public class ProductExpressionImpl extends SizeExpressionImpl implements Product public String toString() { if (eIsProxy()) return super.toString(); - StringBuilder result = new StringBuilder(super.toString()); + StringBuffer result = new StringBuffer(super.toString()); result.append(" (constant: "); result.append(constant); result.append(')'); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/SummationExpressionImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/SummationExpressionImpl.java index b6a785c2185b1eb2be286e893d6ab91a915a5388..9f5d89a3e0bcb0e8c64cccd3f936f1acacb4e506 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/SummationExpressionImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/impl/SummationExpressionImpl.java @@ -255,7 +255,7 @@ public class SummationExpressionImpl extends SizeExpressionImpl implements Summa public String toString() { if (eIsProxy()) return super.toString(); - StringBuilder result = new StringBuilder(super.toString()); + StringBuffer result = new StringBuffer(super.toString()); result.append(" (constant: "); result.append(constant); result.append(')'); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/util/ComputationAdapterFactory.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/util/ComputationAdapterFactory.java index 3f7c227fc813cac252ddd1a9c9414bc733d6b20b..9380ef8addbf04b14c793ab3376f82eaa55dd099 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/util/ComputationAdapterFactory.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/util/ComputationAdapterFactory.java @@ -80,6 +80,10 @@ public class ComputationAdapterFactory extends AdapterFactoryImpl { return createHWTargetDesignAdapter(); } @Override + public Adapter caseBlockGroup(BlockGroup object) { + return createBlockGroupAdapter(); + } + @Override public Adapter caseComputationBlock(ComputationBlock object) { return createComputationBlockAdapter(); } @@ -177,6 +181,20 @@ public class ComputationAdapterFactory extends AdapterFactoryImpl { return null; } + /** + * Creates a new adapter for an object of class '{@link typeexploration.computation.BlockGroup <em>Block Group</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see typeexploration.computation.BlockGroup + * @generated + */ + public Adapter createBlockGroupAdapter() { + return null; + } + /** * Creates a new adapter for an object of class '{@link typeexploration.computation.ComputationBlock <em>Block</em>}'. * <!-- begin-user-doc --> diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/util/ComputationSwitch.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/util/ComputationSwitch.java index 3bc275f0e64928cf2fd5652a638c0e3c60401aed..ed0e22c6a46b5e95b89ef40132c0f2f790504c10 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/util/ComputationSwitch.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src-gen/typeexploration/computation/util/ComputationSwitch.java @@ -84,6 +84,12 @@ public class ComputationSwitch<T> extends Switch<T> { if (result == null) result = defaultCase(theEObject); return result; } + case ComputationPackage.BLOCK_GROUP: { + BlockGroup blockGroup = (BlockGroup)theEObject; + T result = caseBlockGroup(blockGroup); + if (result == null) result = defaultCase(theEObject); + return result; + } case ComputationPackage.COMPUTATION_BLOCK: { ComputationBlock computationBlock = (ComputationBlock)theEObject; T result = caseComputationBlock(computationBlock); @@ -192,6 +198,21 @@ public class ComputationSwitch<T> extends Switch<T> { return null; } + /** + * Returns the result of interpreting the object as an instance of '<em>Block Group</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Block Group</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBlockGroup(BlockGroup object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of '<em>Block</em>'. * <!-- begin-user-doc --> diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src/typeexploration/computation/concrete/ConcreteOperation.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src/typeexploration/computation/concrete/ConcreteOperation.java index 8fc91ef751000f2353353a374691b081eb2a9def..41446aed612738bc7a18ede24b54934a1c44b636 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src/typeexploration/computation/concrete/ConcreteOperation.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src/typeexploration/computation/concrete/ConcreteOperation.java @@ -17,11 +17,6 @@ public class ConcreteOperation { if (BWin1 > 32) { System.err.println("Input1 of concrete operation reduced from " + BWin1 + " to 32 due to library limitations."); BWin1 = 32; } if (BWin2 > 32) { System.err.println("Input2 of concrete operation reduced from " + BWin2 + " to 32 due to library limitations."); BWin2 = 32; } if (BWout > 32) { System.err.println("Output of concrete operation reduced from " + BWout + " to 32 due to library limitations."); BWout = 32; } - - //Force even sizes due to limited data - BWin1 = (int)(2*Math.ceil(BWin1/2.0)); - BWin2 = (int)(2*Math.ceil(BWin2/2.0)); - BWout = (int)(2*Math.ceil(BWout/2.0)); //Force output consistency { diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src/typeexploration/computation/concrete/HWModelParameters.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src/typeexploration/computation/concrete/HWModelParameters.java index 8e9511c3bbb5225dacb5ec922883bb8b9c5b2ed3..d578c0f0f185cede8b19adf991c72bcf5117691e 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src/typeexploration/computation/concrete/HWModelParameters.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src/typeexploration/computation/concrete/HWModelParameters.java @@ -12,6 +12,8 @@ import typeexploration.computation.HWOpType; public class HWModelParameters { + public static boolean DEBUG = true; + private static final Path RESOURCES_LOCATION = Paths.get( HWModelParameters.class.getProtectionDomain().getCodeSource().getLocation().getPath()).resolve("resources"); @@ -56,15 +58,56 @@ public class HWModelParameters { } + private void checkOpConf(OperatorConfiguration conf) { + if (!data.containsKey(conf)) { + throw new RuntimeException("HW parameter for operation does not exist: " + conf); + } + } + public OperatorSpec getData(ConcreteOperation op, int freq) { - OperatorConfiguration operatorTmp = new OperatorConfiguration(op.getType(), op.getInput1BW(), op.getInput2BW(), op.getOutputBW()); - OperatorSpec value; - if (!data.containsKey(operatorTmp)) { - throw new RuntimeException("HW parameter for operation does not exist: " + operatorTmp); + if (op.getInput1BW() < 2 || op.getInput1BW() > 32 || op.getInput2BW() < 2 || op.getInput2BW() > 32 || op.getOutputBW() < 2 || op.getOutputBW() > 32) { + throw new RuntimeException("Cost model only supports wordlengths in [2,32]."); + } + + boolean in1even = op.getInput1BW() % 2 == 0; + boolean in2even = op.getInput2BW() % 2 == 0; + boolean outeven = op.getOutputBW() % 2 == 0; + + final OperatorSpec value; + + //If all values are even, use data from CSV directly + if (in1even && in2even && outeven) { + OperatorConfiguration operatorTmp = new OperatorConfiguration(op.getType(), op.getInput1BW(), op.getInput2BW(), op.getOutputBW()); + + checkOpConf(operatorTmp); + + value = this.data.get(operatorTmp); + + //else need to interpolate + } else { + int[] in1range = in1even?new int[] {op.getInput1BW(),op.getInput1BW()}:new int[] {op.getInput1BW()-1,op.getInput1BW()+1}; + int[] in2range = in2even?new int[] {op.getInput2BW(),op.getInput2BW()}:new int[] {op.getInput2BW()-1,op.getInput2BW()+1}; + int[] outrange = outeven?new int[] {op.getOutputBW(),op.getOutputBW()}:new int[] {op.getOutputBW()-1,op.getOutputBW()+1}; + + if (DEBUG) { + System.err.println(String.format("Interpolating OpConfig: (%d,%d,%d) -> (%d,%d,%d) (%d,%d,%d)", + op.getInput1BW(), op.getInput2BW(), op.getOutputBW(), + in1range[0], in2range[0], outrange[0], in1range[1], in2range[1], outrange[1])); + } + + OperatorConfiguration opConf1 = new OperatorConfiguration(op.getType(), in1range[0], in2range[0], outrange[0]); + OperatorConfiguration opConf2 = new OperatorConfiguration(op.getType(), in1range[1], in2range[1], outrange[1]); + + checkOpConf(opConf1); + checkOpConf(opConf2); + + OperatorSpec val1 = data.get(opConf1); + OperatorSpec val2 = data.get(opConf2); + + value = OperatorSpec.takeMean(val1, val2); } - value = this.data.get(operatorTmp); return value; } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src/typeexploration/computation/concrete/OperatorSpec.java b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src/typeexploration/computation/concrete/OperatorSpec.java index 49f75457231e864b2444f61280989996f4fd394f..2486cfeeeece384b4e086c2f6c34e8bead9f6d42 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src/typeexploration/computation/concrete/OperatorSpec.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.computation/src/typeexploration/computation/concrete/OperatorSpec.java @@ -29,11 +29,18 @@ public class OperatorSpec { public double getDelay() { return delay; } - @Override public String toString() { return " Quantization Error: " + qem + " Area: " + area + " Power: " + power + " Delay: " + delay; } - + + public static OperatorSpec takeMean(OperatorSpec val1, OperatorSpec val2) { + final double area = (val1.area + val2.area )*0.5; + final double power = (val1.power + val2.power)*0.5; + final double delay = (val1.delay + val2.delay)*0.5; + final double qem = (val1.qem + val2.qem )*0.5; + + return new OperatorSpec(area, power, delay, qem); + } } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/default.properties b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/default.properties new file mode 100644 index 0000000000000000000000000000000000000000..79faa0fed7cdf784b5109d37c1c946a3f0cdf9c9 --- /dev/null +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/default.properties @@ -0,0 +1,114 @@ +# Max number of threads to be used: Positive integer value or C to match available Processors +# Default value: C +nbThreads = C + +# Number of times a simulation is repeated.Main usage is to inject content of different files as inputs. +# Default value: 1 +nbSimulations = 1 + +# If false no charts will be created/displayed during exploration: [true, false] +# Default value: true +enableCharts = true + +# Logging level for the main logger: [SEVERE, WARNING, INFO, FINE, ALL] +# Default value: ALL +mainLogLevel = ALL + +# Logging level for the exploration logger: [SEVERE, WARNING, INFO, FINE, ALL] +# Default value: ALL +explorationLogLevel = ALL + +# Exploration Mode: [FIXED, FLOAT, MIXED] +# FIXED: Explore only fixed-point types +# FLOAT: Explore only custom floating-point types +# MIXED: Explore both floating-point and fixed-point types. This mode is not unsupported yet ! +# Default value: FIXED +explorationMode = FIXED + +# If false generate outputs at the same directory (no time tag): [true, false] +# Default value: true +timeTagOutput = true + +# The number of latest time-tagged generated output directories to keep: Positive integer value +# Default value: 3 +nbOutputsToKeep = 5 + +# If true prune solution space before starting the exploration: [true, false] +# Default value: false +pruneFirst = true + +# The factor used for calculating the number of variables simultaneously added 1 bit: [0,1] +# Default value: 0.9 +alpha = 0.9 + +# If true, enable auto jumping mode which allows increasing bw of a variable to max or min after nbOfCheckedSteps times the accuracy unchanged: [true, false] +# Default value: false +enableAutoJump = true + +# Number of latest times adding 1 bit to a variable +# Default value: 2 +nbOfCheckedSteps = 2 + +# Exploration algorithm: [BRUTE_FORCE, MIN_PLUS_ONE, TABU_SEARCH, TABU_SEARCH_PARETO] +# Default value: TABU_SEARCH +explorationAlgo = TABU_SEARCH + +# Comma-separated Accuracy metrics: [MAX_ABS_ERR, PSNR, PSNR_DB, POWER, POWER_DB, SSIM] +# MAX_ABS_ERR: Maximum Absolute Error. Higher values are less accurate +# PSNR: Peak Signal to Noise Ratio. Higher values are more accurate +# PSNR_DB: Peak Signal to Noise Ratio in dB. Higher values are more accurate +# POWER: Noise Power. Higher values are less accurate +# POWER_DB: Noise Power in dB. Higher values are less accurate +# SSIM: Structural Similarity (SSIM). Higher values are more accurate +# Default value: PSNR_DB +accuracyMetric SSIM + +# Comma-separated Threshold values of the corresponding Accuracy Metrics (in the same order). It's considered as a Lower (Upper) bound if higher values -of the specified metric- are considered more (less) accurate +# Default value: 40 +accuracyThreshold = 0.99 + +# Structural Similarity is used as an additional accuracy metric when enabled. +# Default value: false +SSIMenabled = true + +# Variable name to be used for SSIM calculation. +# Default value: +SSIMtarget = matrix_shape + +# Comma-separated Cost metrics: [SUM_W, AREA_MODEL, ENERGY_MODEL] +# SUM_W: The sum of wordlengths of all Symbols. Higher values are more costly +# AREA_MODEL: Simple area cost estimation based on a model of computation. Higher values are more costly +# ENERGY_MODEL: Simple energy estimation based on a model of computation. Higher values are more costly +# Default value: SUM_W +costMetric = AREA_MODEL + +# How to merge Error stats from all snapshots of a given Symbol: [MEAN, CONCAT, WORST] +# MEAN: Take the mean between error signals i.e. as if computing the error stats of a signal obtained as the mean of all error signals. +# CONCAT: Take the Concatenation of error signals i.e. as if computing the error stats of a signal obtained as the concatenation of all error signals. +# WOult value: MEAN +snapshotsErrorMerge = MEAN + +# How to merge Error stats from all output Symbols (after merging their snapshots): [MEAN, CONCAT, WORST] +# MEAN: RST: Not yet supported! +# DefaTake the mean between error signals i.e. as if computing the error stats of a signal obtained as the mean of all error signals. +# CONCAT: Take the Concatenation of error signals i.e. as if computing the error stats of a signal obtained as the concatenation of all error signals. +# WORST: Not yet supported! +# Default value: CONCAT +symbolsErrorMerge = CONCAT + +# The default wordlength values to use for Symbols without EXPLORE_FIX pragma: Comma-separated, Positive integer value or value range (min..max) +# Default value: 32 +defaultFixedW = 64 + +# The default integer-part-length values to use for Symbols without EXPLORE_FIX pragma: Comma-separated, Positive integer value or value range (min..max) +# Default value: 16 +defaultFixedI = 24 + +# The default wordlength values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated, Positive integer value or value range (min..max) +# Default value: 32 +defaultFloatW = 32 + +# The default exponent length values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated, Positive integer value or value range (min..max) +# Default value: 8 +defaultFloatE = 8 + diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/isp_fixed.costdsl b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/isp_fixed.costdsl new file mode 100644 index 0000000000000000000000000000000000000000..718aa07590f8e986af08f94cf5fa7696a6cd3973 --- /dev/null +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/isp_fixed.costdsl @@ -0,0 +1,53 @@ +param H=240; +param W=320; +param K=24; +param K2=48; +param K3=72; +param H1=384; +param W1=512; + +target { + frequency = 500 + outputsPerCycle = 2 + problemSize = H W +} + +//block nlm { +// // my_imfilter_3_nlm function +// MUL : (filter_nlm + in_pad_nlm) = filter_nlm op in_pad_nlm x 9 H W; +// ADD : tmp_fil_nlm = tmp_fil_nlm op max(filter_nlm, in_pad_nlm) x 9 H W; +// // +// ADD : mat_in_pad = mat_in_pad op mat_in_pad x K2 H W; +// MUL : sqdiff_current = mat_in_pad op mat_in_pad x K H W; +// ADD : sqdiff_prev = sqdiff_current op sqdiff_prev x K H W; +// ADD : sqdiff_save = sqdiff_current op mat_sqdiff x K H W; +// ADD : tmp_dist = mat_sqdiff op mat_sqdiff x K3 H W; +// MUL : (np1 + filt_matrix_nlm) = np1 op filt_matrix x K H W; +// ADD : nv = np2 op max(np1,filt_matrix_nlm) x K H W; +// ADD : pre_exp = tmp_dist op nv x K H W; +// MUL : denoised = weight op mat_in_pad x K H W; +// ADD : mat_out_nlm = mat_out_nlm op denoised x K H W; +// ADD : mat_acc_weight = mat_acc_weight op weight x K H W; +// ADD : max(mat_out_nlm, mat_in_pad) = mat_out_nlm op mat_in_pad x H W; +//// //this multiplication is actually a division +// MUL : mat_out_nlm = mat_acc_weight op max(mat_out_nlm, mat_in_pad) x H W; +//} + +block unsharp { + MUL : (in_unsharpf + coeff) = in_unsharpf op coeff x 9 H W; + ADD : in_unsharpf = in_unsharpf op coeff x 6 H W; + MUL : (in_unsharpf + CST_1) = in_unsharpf op CST_1 x H W; + ADD : in_unsharpf = max(in_unsharpf, CST_1) op CST_2 x H W; + MUL : (in_unsharpf + f_unsharpf) = in_unsharpf op f_unsharpf x 7 H W; + ADD : blur_v = in_unsharpf op f_unsharpf x 7 H W; + MUL : (filt_tmp + f_unsharpf) = filt_tmp op f_unsharpf x 7 H W; + ADD : blur_h = filt_tmp op f_unsharpf x 7 H W; + ADD : g = in_unsharpf op blur_h x H W; + MUL : (amount_unsharpf + g) = amount_unsharpf op g x H W; + ADD : mask = in_unsharpf op max(amount_unsharpf,g) x H W; + MUL : (mask + CST_3) = mask op CST_3 x H W; + ADD : l_full = max(mask, CST_3) op CST_4 x H W; + MUL : (l_full + coefb) = l_full op coefb x 3 H W; + MUL : (in_unsharpf + coefb) = in_unsharpf op coefb x 6 H W; + ADD : out_unsharpf = in_unsharpf op coefb x 6 H W; +} diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/src-c/isp_core.c b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/src-c/isp_core.c new file mode 100644 index 0000000000000000000000000000000000000000..a779c17df09eccdfeb6001eabd3982f88ec41dc9 --- /dev/null +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/src-c/isp_core.c @@ -0,0 +1,1347 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <math.h> +#include "utils.h" + +#define __GECOS_TYPE_EXPL__ + +// #define __NLM_WLO__ +#define __UNSHARP_WLO__ + +// Parameters +//#define H 2976 +//#define W 3968 +#define H 240 +#define W 320 +#define H3 720 +#define IMAGE_SIZE H*W +#define K 5 +#define N 13 +#define K2 2 +#define N2 6 +#define CROP 4 +#define KK 25 + +//size_h_pad = H+2*N2; +#define SIZE_H_PAD (H+2*N2) //2988 +//size_w_pad = W+2*N2; +#define SIZE_W_PAD (W+2*N2) //3980 + +#define S 2 + +//size_h_ref = H + N2 - K2 +#define SIZE_H_REF (H + N2 - K2) //2980 +//size_w_ref = W + N2 - K2 +#define SIZE_W_REF (W + N2 - K2) //3972 + +#define ROW_FILT 3 +#define COL_FILT 3 + +#define PATCH_SIZE 24 +#define HSIZE 7 + +#define SIZE_H_FIL_3 (H+2) +#define SIZE_W_FIL_3 (W+2) + +#define SIZE_H_FIL_5 (H+4) +#define SIZE_W_FIL_5 (W+4) + +// Macro functions +#ifndef max +#define max(a,b) ((a) > (b) ? (a) : (b)) +#endif + +#ifndef min +#define min(a,b) ((a) < (b) ? (a) : (b)) +#endif + +#ifndef sqr +#define sqr(a) ((a)*(a)) +#endif + +// Bayer types +enum bayer_type{rggb, bggr, grbg, gbrg}; +enum padding_option{replicate, zeros}; + +// Parameter +#define DTYPE float +#define DTYPE_DOUBLE double +#define SIZE_T int + +// nlm's constants +const int dx_patch[24] = {-4,-2,0,2,4,-4,-2,0,2,4,-4,-2,2,4,-4,-2,0,2,4,-4,-2,0,2,4}; +const int dy_patch[24] = {-4,-4,-4,-4,-4,-2,-2,-2,-2,-2,0,0,0,0,2,2,2,2,2,4,4,4,4,4}; + + +// wb's constants +const DTYPE wb_multipliers[4] = {1.259157509, 1.0, 2.666666667, 1.0}; + +// cc's constants +const DTYPE cam2rgb[9] = {1.952148438,-0.837890625,-0.114257813,-0.387695313,1.728515625,-0.340820313,-0.083984375,-1.018554688,2.102539062}; +#define PIXEL_NUM ((H-8)*(W-8)/4) + + +void my_imfilter_5(DTYPE mat_out[H][W], DTYPE mat_in[H][W], DTYPE in_pad[SIZE_H_FIL_5][SIZE_W_FIL_5], const DTYPE* filter, padding_option mode) +{ + SIZE_T i, j, p, q; + + SIZE_T r2 = 2; + SIZE_T c2 = 2; + SIZE_T row = 5; + SIZE_T col = 5; + + for(i=-r2; i<H+r2; i++) + { + for(j=-c2; j<W+c2; j++) + { + if (mode == replicate) + { + /* replicate padding for input image */ + in_pad[(i+r2)][j+c2] = mat_in[min(max(i,0),H-1)][min(max(j,0),W-1)]; + } + else + { + /* zero padding for input image */ + if(i>=0 && i<H && j>=0 && j<W) + in_pad[(i+r2)][j+c2] = mat_in[i][j]; + else + in_pad[(i+r2)][j+c2] = 0.0; + } + } + } + + DTYPE tmp; + // Do filtering + for(i=r2; i<H+r2; i++) + { + for(j=c2; j<W+c2; j++) + { + tmp = 0.0; + for(p=0; p<row; p++) + { + for(q=0; q<col; q++) + { + tmp = tmp + filter[p*col+q]*in_pad[((i-r2)+p)][(j-c2)+q]; + } + } + mat_out[(i-r2)][(j-c2)] = tmp; + } + } + +} + + +void my_imfilter_3_nlm(DTYPE filt_matrix_nlm[H][W], DTYPE mat_in_nlm[H][W], DTYPE in_pad_nlm[SIZE_H_FIL_3][SIZE_W_FIL_3], const DTYPE* filter_nlm, padding_option mode) +{ + SIZE_T i, j, p, q; + + SIZE_T r2 = 1; + SIZE_T c2 = 1; + SIZE_T row = 3; + SIZE_T col = 3; + + for(i=-r2; i<H+r2; i++) + { + for(j=-c2; j<W+c2; j++) + { + if (mode == replicate) + { + /* replicate padding for input image */ + in_pad_nlm[(i+r2)][j+c2] = mat_in_nlm[min(max(i,0),H-1)][min(max(j,0),W-1)]; + } + else + { + /* zero padding for input image */ + if(i>=0 && i<H && j>=0 && j<W) + in_pad_nlm[(i+r2)][j+c2] = mat_in_nlm[i][j]; + else + in_pad_nlm[(i+r2)][j+c2] = 0.0; + } + } + } +#ifdef __NLM_WLO__ +#pragma EXPLORE_CONSTRAINT SAME = mat_in_nlm +#endif + DTYPE tmp_fil_nlm; + // Do filtering + for(i=r2; i<H+r2; i++) + { + for(j=c2; j<W+c2; j++) + { + tmp_fil_nlm = 0.0; + for(p=0; p<row; p++) + { + for(q=0; q<col; q++) + { + tmp_fil_nlm = tmp_fil_nlm + filter_nlm[p*col+q]*in_pad_nlm[((i-r2)+p)][(j-c2)+q]; + } + } + filt_matrix_nlm[(i-r2)][(j-c2)] = tmp_fil_nlm; + } + } + +} + +void my_imfilter_3(DTYPE mat_out[H][W], DTYPE mat_in[H][W], DTYPE in_pad[SIZE_H_FIL_3][SIZE_W_FIL_3], const DTYPE* filter, padding_option mode) +{ + SIZE_T i, j, p, q; + + SIZE_T r2 = 1; + SIZE_T c2 = 1; + SIZE_T row = 3; + SIZE_T col = 3; + + for(i=-r2; i<H+r2; i++) + { + for(j=-c2; j<W+c2; j++) + { + if (mode == replicate) + { + /* replicate padding for input image */ + in_pad[(i+r2)][j+c2] = mat_in[min(max(i,0),H-1)][min(max(j,0),W-1)]; + } + else + { + /* zero padding for input image */ + if(i>=0 && i<H && j>=0 && j<W) + in_pad[(i+r2)][j+c2] = mat_in[i][j]; + else + in_pad[(i+r2)][j+c2] = 0.0; + } + } + } + + + DTYPE tmp; + // Do filtering + for(i=r2; i<H+r2; i++) + { + for(j=c2; j<W+c2; j++) + { + tmp = 0.0; + for(p=0; p<row; p++) + { + for(q=0; q<col; q++) + { + tmp = tmp + filter[p*col+q]*in_pad[((i-r2)+p)][(j-c2)+q]; + } + } + mat_out[(i-r2)][(j-c2)] = tmp; + } + } + +} + +void my_imfilter_3_1(DTYPE mat_out[H][W], DTYPE mat_in[H][W], DTYPE in_pad[SIZE_H_FIL_3][SIZE_W_FIL_3], const DTYPE* filter, padding_option mode) +{ + SIZE_T i, j, p, q; + + SIZE_T r2 = 1; + SIZE_T c2 = 1; + SIZE_T row = 3; + SIZE_T col = 3; + + for(i=-r2; i<H+r2; i++) + { + for(j=-c2; j<W+c2; j++) + { + if (mode == replicate) + { + /* replicate padding for input image */ + in_pad[(i+r2)][j+c2] = mat_in[min(max(i,0),H-1)][min(max(j,0),W-1)]; + } + else + { + /* zero padding for input image */ + if(i>=0 && i<H && j>=0 && j<W) + in_pad[(i+r2)][j+c2] = mat_in[i][j]; + else + in_pad[(i+r2)][j+c2] = 0.0; + } + } + } + + DTYPE tmp; + // Do filtering + for(i=r2; i<H+r2; i++) + { + for(j=c2; j<W+c2; j++) + { + tmp = 0.0; + for(p=0; p<row; p++) + { + for(q=0; q<col; q++) + { + tmp = tmp + filter[p*col+q]*in_pad[((i-r2)+p)][(j-c2)+q]; + } + } + mat_out[(i-r2)][(j-c2)] = tmp; + } + } + +} + +void my_imfilter_two_input_5(DTYPE mat_out[H][W], DTYPE mat_in_1[H][W], DTYPE mat_in_2[H][W], DTYPE in_pad[SIZE_H_FIL_5][SIZE_W_FIL_5], const DTYPE* filter) +{ + SIZE_T i, j, p, q; + + SIZE_T r2 = 2; + SIZE_T c2 = 2; + SIZE_T row = 5; + SIZE_T col = 5; + + for(i=-r2; i<H+r2; i++) + { + for(j=-c2; j<W+c2; j++) + { + if(i>=0 && i<H && j>=0 && j<W) + in_pad[(i+r2)][j+c2] = mat_in_1[i][j] + mat_in_2[i][j]; + else + in_pad[(i+r2)][j+c2] = 0.0; + } + } + + DTYPE tmp; + // Do filtering + for(i=r2; i<H+r2; i++) + { + for(j=c2; j<W+c2; j++) + { + tmp = 0.0; + for(p=0; p<row; p++) + { + for(q=0; q<col; q++) + { + tmp = tmp + filter[p*col+q]*in_pad[((i-r2)+p)][(j-c2)+q]; + } + } + mat_out[(i-r2)][(j-c2)] = tmp; + } + } +} + + + +void do_loop( + DTYPE mat_out_nlm[H][W], + DTYPE filt_matrix_nlm[H][W], + DTYPE mat_in_pad[SIZE_H_PAD][SIZE_W_PAD], + DTYPE_DOUBLE mat_sqdiff[SIZE_H_REF][SIZE_W_REF], + DTYPE mat_acc_weight[H][W], + DTYPE np1, + DTYPE np2, + DTYPE thr +) +{ + SIZE_T i, j, k; +#ifdef __NLM_WLO__ +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE_DOUBLE tmp_dist; +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE pre_exp; +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE denoised; +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE nv; + +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE_DOUBLE sqdiff_current; +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE_DOUBLE sqdiff_save; +#pragma EXPLORE_FIX W={7..16} I={5} +// #pragma EXPLORE_CONSTRAINT SAME = sqdiff_current + DTYPE_DOUBLE sqdiff_prev; +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE weight; +#else + DTYPE_DOUBLE tmp_dist; + DTYPE pre_exp; + DTYPE denoised; + DTYPE nv; + + DTYPE_DOUBLE sqdiff_current; + DTYPE_DOUBLE sqdiff_save; + DTYPE_DOUBLE sqdiff_prev; + DTYPE weight; +#endif + + // Initialization + for(i=0;i<H;i++) + { + for(j=0;j<W;j++) + { + mat_out_nlm[i][j] = 0; + mat_acc_weight[i][j] = 0; + } + } + + for (int k = 0; k < PATCH_SIZE; k++) + { + tmp_dist = 0; + sqdiff_prev = 0; + sqdiff_save = 0; + for (int i = CROP; i < SIZE_H_REF + CROP; i++) + { + for (int j = CROP; j < SIZE_W_REF + CROP; j++) + { + sqdiff_current = (DTYPE_DOUBLE)((mat_in_pad[i][j] - mat_in_pad[i+dy_patch[k]][j+dx_patch[k]])*(mat_in_pad[i][j] - mat_in_pad[i+dy_patch[k]][j+dx_patch[k]])); + + if (i==CROP && j==CROP) { + sqdiff_save = sqdiff_current; + sqdiff_prev = sqdiff_current; + } else if (i==CROP && j> CROP) { + sqdiff_save = sqdiff_current + sqdiff_prev; + sqdiff_prev = sqdiff_current + sqdiff_prev; + } else if(i> CROP && j==CROP) { + sqdiff_save = sqdiff_current + mat_sqdiff[i-CROP-1][j-CROP]; + sqdiff_prev = sqdiff_current; + } else if(i> CROP && j> CROP) { + sqdiff_save = sqdiff_current + sqdiff_prev + mat_sqdiff[i-CROP-1][j-CROP]; + sqdiff_prev = sqdiff_current + sqdiff_prev; + } + mat_sqdiff[i-CROP][j-CROP] = sqdiff_save; + + /// Calculate mat_denoised and mat_acc_weight + if((i>=CROP+K-1) && (j>=CROP+K-1)) + { + if(i==CROP+K-1 && j==CROP+K-1) { + tmp_dist = mat_sqdiff[i-CROP][j-CROP]; + } else if(i> CROP+K-1 && j==CROP+K-1) { + tmp_dist = mat_sqdiff[i-CROP][j-CROP] - mat_sqdiff[i-K-CROP][j-CROP]; + } else if(i==CROP+K-1 && j> CROP+K-1) { + tmp_dist = mat_sqdiff[i-CROP][j-CROP] - mat_sqdiff[i-CROP][j-K-CROP]; + } else if(i> CROP+K-1 && j> CROP+K-1) { + tmp_dist = mat_sqdiff[i-CROP][j-CROP] - mat_sqdiff[i-K-CROP][j-CROP] - mat_sqdiff[i-CROP][j-K-CROP] + mat_sqdiff[i-K-CROP][j-K-CROP]; + } + + nv = np1*filt_matrix_nlm[i-CROP-K+1][j-CROP-K+1] + np2; + + +#ifndef __GECOS_TYPE_EXPL__ + // !! changed + // pre_exp = -max((tmp_dist)/(K*K) - 2*nv, 0); + pre_exp = -max((double)(tmp_dist)/KK - (double)(2*nv), 0); + weight = pow(2.7182817, pre_exp/(thr*thr*nv)); +#else + pre_exp = tmp_dist - 2*nv*KK; + if (pre_exp <= 0) + weight = 1; + else + weight = 0; +#endif + + + // Compute and accumulate denoised pixels + denoised = weight * mat_in_pad[i-K2+dy_patch[k]][j-K2+dx_patch[k]]; + mat_out_nlm[i-CROP-K+1][j-CROP-K+1] = mat_out_nlm[i-CROP-K+1][j-CROP-K+1] + denoised; + + // Update accumlated weights + mat_acc_weight[i-CROP-K+1][j-CROP-K+1] = mat_acc_weight[i-CROP-K+1][j-CROP-K+1] + weight; + } + + } + } + } + + + for(i=0; i<H; i++) + { + for(j=0; j<W; j++) + { + mat_out_nlm[i][j] = (mat_out_nlm[i][j] + mat_in_pad[i+N2][j+N2])/(mat_acc_weight[i][j] + 1); + } + } +} + +void nlm( +#ifdef __NLM_WLO__ +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE mat_out[H][W], +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE mat_in_nlm[H][W], +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE filt_matrix_nlm[H][W], +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE mat_in_pad[SIZE_H_PAD][SIZE_W_PAD], +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE in_pad_nlm[SIZE_H_FIL_3][SIZE_W_FIL_3], +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE_DOUBLE mat_sqdiff[SIZE_H_REF][SIZE_W_REF], +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE mat_acc_weight[H][W], +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE np1, +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE np2, +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE thr, +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE black +#else + DTYPE mat_out[H][W], + DTYPE mat_in_nlm[H][W], + DTYPE filt_matrix_nlm[H][W], + DTYPE mat_in_pad[SIZE_H_PAD][SIZE_W_PAD], + DTYPE in_pad_nlm[SIZE_H_FIL_3][SIZE_W_FIL_3], + DTYPE_DOUBLE mat_sqdiff[SIZE_H_REF][SIZE_W_REF], + DTYPE mat_acc_weight[H][W], + DTYPE np1, + DTYPE np2, + DTYPE thr, + DTYPE black +#endif + ) +{ + +#ifdef __NLM_WLO__ +#pragma EXPLORE_FIX W={7..16} I={5} + const DTYPE filter_nlm[9] = {0.0625, 0.1250, 0.0625, 0.1250, 0.2500, 0.1250, 0.0625, 0.1250, 0.0625}; +#else + const DTYPE filter_nlm[9] = {0.0625, 0.1250, 0.0625, 0.1250, 0.2500, 0.1250, 0.0625, 0.1250, 0.0625}; +#endif + + SIZE_T i, j; /* Counter variables */ + + /* replicate padding for input image */ + for(i=-N2; i<H+N2; i++) + { + for(j=-N2; j<W+N2; j++) + { + mat_in_pad[i+N2][j+N2] = mat_in_nlm[min(max(i,0),H-1)][min(max(j,0),W-1)]; + } + } + + padding_option option = replicate; + + my_imfilter_3_nlm(filt_matrix_nlm, mat_in_nlm, in_pad_nlm, filter_nlm, option); + + for(i=0; i<H; i++) + { + for(j=0; j<W; j++) + { + filt_matrix_nlm[i][j] = max((double)(filt_matrix_nlm[i][j] - black), 0.0); + } + } + + + do_loop(mat_out, filt_matrix_nlm, mat_in_pad, mat_sqdiff, mat_acc_weight, np1, np2, thr); + +} + +void linearize(DTYPE in[H][W], DTYPE out[H][W], DTYPE black) +{ + SIZE_T i, j; + + double cnt = 1.066736184; + + for(i=0; i<H; i++) + { + for(j=0; j<W; j++) + { +#ifdef __GECOS_TYPE_EXPL__ + out[i][j] = (in[i][j] - black)*cnt; +#else + out[i][j] = (in[i][j] - black)/(1.0 - black); +#endif + + if(out[i][j] < 0.0) out[i][j] = 0.0; + if(out[i][j] > 1.0) out[i][j] = 1.0; // bypass Vignetting Correction + } + } +} + +void wb(DTYPE in[H][W], DTYPE out[H][W], bayer_type type) +{ + SIZE_T i, j; + + // SIZE_T len_mat = sizeof(wb_multipliers)/sizeof(wb_multipliers[0]); + // if(len_mat == 3) // only one G multiplier supplied + // { + // wb_multipliers = (MULT_MAT_WB*)realloc(wb_multipliers, sizeof(MULT_MAT_WB)*4); + // wb_multipliers[3] = wb_multipliers[1]; + // } + + // for(i=0; i<H; i++) + // { + // for(j=0; j<W; j++) + // { + // out[i][j] = wb_multipliers[1]; + // } + // } + + for (i=0; i<H; i++) + { + for(j=0; j<W; j++) + { + if((i%2 == 0) && (j%2 == 0)) + { + if (type == rggb) out[i][j] = wb_multipliers[0]; + else if (type == bggr) out[i][j] = wb_multipliers[2]; + else if (type == grbg) out[i][j] = wb_multipliers[1]; + else out[i][j] = wb_multipliers[3]; + } + else if ((i%2 == 0) && (j%2 == 1)) + { + if (type == rggb) out[i][j] = wb_multipliers[1]; + else if (type == bggr) out[i][j] = wb_multipliers[3]; + else if (type == grbg) out[i][j] = wb_multipliers[2]; + else out[i][j] = wb_multipliers[2]; + } + else if ((i%2 == 1) && (j%2 == 0)) + { + if (type == rggb) out[i][j] = wb_multipliers[3]; + else if (type == bggr) out[i][j] = wb_multipliers[1]; + else if (type == grbg) out[i][j] = wb_multipliers[1]; + else out[i][j] = wb_multipliers[0]; + } + else + { + if (type == rggb) out[i][j] = wb_multipliers[2]; + else if (type == bggr) out[i][j] = wb_multipliers[0]; + else if (type == grbg) out[i][j] = wb_multipliers[3]; + else out[i][j] = wb_multipliers[1]; + } + + out[i][j] = out[i][j] * in[i][j]; + if(out[i][j] > 1.0) out[i][j] = 1.0; + } + } + + // free(wb_multipliers); + +} + +void demmhc( + DTYPE in[H][W], + DTYPE out[3*H*W], + bayer_type type, + DTYPE r_dc[H][W], + DTYPE g_dc[H][W], + DTYPE b_dc[H][W], + DTYPE gh[H][W], + DTYPE gv[H][W], + DTYPE tmp_dc_0[H][W], + DTYPE tmp_dc_1[H][W], + DTYPE tmp_dc_2[H][W], + DTYPE tmp_dc_3[H][W], + DTYPE tmp_dc_4[H][W], + DTYPE in_pad_gh[SIZE_H_FIL_5][SIZE_W_FIL_5], + DTYPE in_pad_gv[SIZE_H_FIL_5][SIZE_W_FIL_5], + DTYPE in_pad_tmp_dc_0[SIZE_H_FIL_3][SIZE_W_FIL_3], + DTYPE in_pad_tmp_dc_1[SIZE_H_FIL_5][SIZE_W_FIL_5], + DTYPE in_pad_tmp_dc_2[SIZE_H_FIL_5][SIZE_W_FIL_5], + DTYPE in_pad_tmp_dc_3[SIZE_H_FIL_3][SIZE_W_FIL_3], + DTYPE in_pad_tmp_dc_4[SIZE_H_FIL_3][SIZE_W_FIL_3] +) +{ + + DTYPE f_g_0[25] = {0.0, 0.0, 0.0625, 0.0, 0.0, 0.0, -0.125, 0.0, -0.125, 0.0, -0.125, 0.5, 0.625, 0.5, -0.125, 0.0, -0.125, 0.0, -0.125, 0.0, 0.0, 0.0, 0.0625, 0.0, 0.0}; + DTYPE f_g_1[25] = {0.0, 0.0,-0.125, 0.0, 0.0, 0.0,-0.125, 0.5, -0.125, 0.0, 0.0625, 0.0, 0.625, 0.0, 0.0625, 0.0, -0.125, 0.5, -0.125, 0.0, 0.0, 0.0, -0.125, 0.0, 0.0}; + DTYPE f_g_2[9] = {0.0, 0.25, 0.0, 0.25, 0.0, 0.25, 0.0, 0.25, 0.0}; + DTYPE f_g_3[25] = {0.0, 0.0, -0.125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.125, 0.0, 0.5, 0.0, -0.125, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.125, 0.0, 0.0}; + DTYPE f_rb_0[25] = {0.0, 0.0, -0.1875, 0.0, 0.0, 0.0, 0.25, 0.0, 0.25, 0.0, -0.1875, 0.0, 0.75, 0.0, -0.1875, 0.0, 0.25, 0.0, 0.25, 0.0, 0.0, 0.0, -0.1875, 0.0,0.0}; + DTYPE f_rb_1[9] = {0.0 ,0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0}; + + + SIZE_T i,j; + padding_option option = zeros; + + // if(type == rggb) + // { + // int r[4] = {1, 0, 0, 0}; + // int gr[4] = {0, 1, 0, 0}; + // int gb[4] = {0, 0, 1, 0}; + // int b[4] = {0, 0, 0, 1}; + // } + // else if(type == bggr) + // { + SIZE_T r[4] = {0, 0, 0, 1}; + SIZE_T gr[4] = {0, 0, 1, 0}; + SIZE_T gb[4] = {0, 1, 0, 0}; + SIZE_T b[4] = {1, 0, 0, 0}; + // } + // else if(type == gbrg) + // { + // int r[4] = {0, 0, 1, 0}; + // int gr[4] = {1, 0, 0, 0}; + // int gb[4] = {0, 0, 0, 1}; + // int b[4] = {0, 1, 0, 0}; + // } + // else + // { + // int r[4] = {0, 1, 0, 0}; + // int gr[4] = {0, 0, 0, 1}; + // int gb[4] = {1, 0, 0, 0}; + // int b[4] = {0, 0, 1, 0}; + // } + + + + for(i=0; i<H; i++) + { + for(j=0; j<W; j++) + { + if((i%2 == 0) && (j%2 == 0)) + { + if (r[0] == 1) r_dc[i][j] = in[i][j]; + else r_dc[i][j] = 0.0; + + if((gr[0] | gb[0]) == 1) g_dc[i][j] = in[i][j]; + else g_dc[i][j] = 0.0; + + if(b[0] == 1) b_dc[i][j] = in[i][j]; + else b_dc[i][j] = 0.0; + } + else if ((i%2 == 0) && (j%2 == 1)) + { + if (r[1] == 1) r_dc[i][j] = in[i][j]; + else r_dc[i][j] = 0.0; + + if((gr[1] | gb[1]) == 1) g_dc[i][j] = in[i][j]; + else g_dc[i][j] = 0.0; + + if(b[1] == 1) b_dc[i][j] = in[i][j]; + else b_dc[i][j] = 0.0; + } + else if ((i%2 == 1) && (j%2 == 0)) + { + if (r[2] == 1) r_dc[i][j] = in[i][j]; + else r_dc[i][j] = 0.0; + + if((gr[2] | gb[2]) == 1) g_dc[i][j] = in[i][j]; + else g_dc[i][j] = 0.0; + + if(b[2] == 1) b_dc[i][j] = in[i][j]; + else b_dc[i][j] = 0.0; + } + else + { + if (r[3] == 1) r_dc[i][j] = in[i][j]; + else r_dc[i][j] = 0.0; + + if((gr[3] | gb[3]) == 1) g_dc[i][j] = in[i][j]; + else g_dc[i][j] = 0.0; + + if(b[3] == 1) b_dc[i][j] = in[i][j]; + else b_dc[i][j] = 0.0; + } + } + } + + + my_imfilter_5(gh, g_dc, in_pad_gh, f_g_0, option); + my_imfilter_5(gv, g_dc, in_pad_gv, f_g_1, option); + my_imfilter_3(tmp_dc_0, g_dc, in_pad_tmp_dc_0, f_g_2, option); + my_imfilter_two_input_5(tmp_dc_1, r_dc, b_dc, in_pad_tmp_dc_1, f_g_3); + + DTYPE tmp0, tmp1; + + for (i=0; i<H; i++) + { + for (j=0; j<W; j++) + { + tmp0 = g_dc[i][j] + tmp_dc_0[i][j] + tmp_dc_1[i][j]; + if (tmp0 < 0.0) tmp0 = 0.0; + if (tmp0 > 1.0) tmp0 = 1.0; + out[i*W+j + IMAGE_SIZE] = tmp0; + // out_g[i][j] = tmp0; + } + } + + my_imfilter_two_input_5(tmp_dc_2, r_dc, b_dc, in_pad_tmp_dc_2, f_rb_0); + my_imfilter_3_1(tmp_dc_3, b_dc, in_pad_tmp_dc_3, f_rb_1, option); + + + + for (i=0; i<H; i++) + { + for (j=0; j<W; j++) + { + if((i%2 == 0) && (j%2 == 0)) + { + tmp1 = tmp_dc_2[i][j]*r[0] + gh[i][j]*gb[0] + gv[i][j]*gr[0]; + } + else if ((i%2 == 0) && (j%2 == 1)) + { + tmp1 = tmp_dc_2[i][j]*r[1] + gh[i][j]*gb[1] + gv[i][j]*gr[1]; + } + else if ((i%2 == 1) && (j%2 == 0)) + { + tmp1 = tmp_dc_2[i][j]*r[2] + gh[i][j]*gb[2] + gv[i][j]*gr[2]; + } + else + { + tmp1 = tmp_dc_2[i][j]*r[3] + gh[i][j]*gb[3] + gv[i][j]*gr[3]; + } + tmp0 = b_dc[i][j] + tmp_dc_3[i][j] + tmp1; + if (tmp0 < 0.0) tmp0 = 0.0; + if (tmp0 > 1.0) tmp0 = 1.0; + out[i*W+j + 2*IMAGE_SIZE] = tmp0; + // out_b[i][j] = tmp0; + } + } + + my_imfilter_3_1(tmp_dc_4, r_dc, in_pad_tmp_dc_4, f_rb_1, option); + for (i=0; i<H; i++) + { + for (j=0; j<W; j++) + { + if((i%2 == 0) && (j%2 == 0)) + { + tmp1 = tmp_dc_2[i][j]*b[0] + gh[i][j]*gr[0] + gv[i][j]*gb[0]; + } + else if ((i%2 == 0) && (j%2 == 1)) + { + tmp1 = tmp_dc_2[i][j]*b[1] + gh[i][j]*gr[1] + gv[i][j]*gb[1]; + } + else if ((i%2 == 1) && (j%2 == 0)) + { + tmp1 = tmp_dc_2[i][j]*b[2] + gh[i][j]*gr[2] + gv[i][j]*gb[2]; + } + else + { + tmp1 = tmp_dc_2[i][j]*b[3] + gh[i][j]*gr[3] + gv[i][j]*gb[3]; + } + tmp0 = r_dc[i][j] + tmp_dc_4[i][j] + tmp1; + if (tmp0 < 0.0) tmp0 = 0.0; + if (tmp0 > 1.0) tmp0 = 1.0; + out[i*W+j] = tmp0; + // out_r[i][j] = tmp0; + } + } + + +} + +void color_correction(DTYPE in[3*IMAGE_SIZE], DTYPE out[3*IMAGE_SIZE]) +{ + SIZE_T i, j, k; + + DTYPE tmp; + + for(i=0; i<H; i++) + { + for(j=0; j<W; j++) + { + tmp = in[i*W+j]*cam2rgb[0] + in[i*W+j + IMAGE_SIZE]*cam2rgb[1] + in[i*W+j + 2*IMAGE_SIZE]*cam2rgb[2]; + if (tmp < (0.0)) tmp = (0.0); + if (tmp > (1.0)) tmp = (1.0); + out[i*W+j] = tmp; + + tmp = in[i*W+j]*cam2rgb[3] + in[i*W+j + IMAGE_SIZE]*cam2rgb[4] + in[i*W+j + 2*IMAGE_SIZE]*cam2rgb[5]; + if (tmp < (0.0)) tmp = (0.0); + if (tmp > (1.0)) tmp = (1.0); + out[i*W+j + IMAGE_SIZE] = tmp; + + tmp = in[i*W+j]*cam2rgb[6] + in[i*W+j + IMAGE_SIZE]*cam2rgb[7] + in[i*W+j + 2*IMAGE_SIZE]*cam2rgb[8]; + if (tmp < (0.0)) tmp = (0.0); + if (tmp > (1.0)) tmp = (1.0); + out[i*W+j + 2*IMAGE_SIZE] = tmp; + } + } + +} + +void gamma_bright_correction(DTYPE in[3*IMAGE_SIZE], DTYPE out[3*IMAGE_SIZE]) +{ + DTYPE_DOUBLE tmp, tmp1, tmp2, tmp3; + DTYPE grayscale; + SIZE_T i, j, k; + + double CNT_GB_0 = 0.2989; + double CNT_GB_1 = 0.5870; + double CNT_GB_2 = 0.1140; + double CNT_GB_3 = 0.045; + double CNT_GB_4 = 1.055; + double CNT_GB_5 = 0.055; + double CNT_GB_6 = 1.0/2.4; + double CNT_GB_7 = 0.0031308; + double CNT_GB_8 = 12.92; + double CNT_GB_9 = 0.18; + // RGB to Gray + tmp = 0; + for(i=4; i<H-4; i=i+2) + { + for(j=4; j<W-4; j=j+2) + { + tmp += (in[i*W+j]*CNT_GB_0 + in[i*W+j + IMAGE_SIZE]*CNT_GB_1 + in[i*W+j + 2*IMAGE_SIZE]*CNT_GB_2)/PIXEL_NUM; + } + } + + // grayscale = 0.18*(H-8)*(W-8)/(4*tmp); + // grayscale = CNT_GB_3*(H-8)*(W-8)/tmp; + grayscale = CNT_GB_9/tmp; + + tmp1 = 0; + for(k=0; k<3; k++) + { + for(i=0; i<H; i++) + { + for(j=0; j<W; j++) + { + // Brightness correction + tmp1 = grayscale*in[i*W+j+k*W*H]; + if (tmp1 > 1) tmp1 = 1; + + // Gamma correction + tmp3 = pow(tmp1, CNT_GB_6); + tmp2 = CNT_GB_4*tmp3 - CNT_GB_5; + if(tmp1<=CNT_GB_7) tmp2 = CNT_GB_8*tmp1; + out[i*W+j+k*W*H] = tmp2; + // out[i*W+j+k*W*H] = in[i*W+j+k*W*H]; + + } + } + } + +} + +void unsharpf( +#ifdef __UNSHARP_WLO__ +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE in_unsharpf[W*H*3], +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE out_unsharpf[W*H*3], +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE f_unsharpf[HSIZE], +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE amount_unsharpf, +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE thr_unsharpf +#else + DTYPE in_unsharpf[W*H*3], + DTYPE out_unsharpf[W*H*3], + DTYPE f_unsharpf[HSIZE], + DTYPE amount_unsharpf, + DTYPE thr_unsharpf +#endif + ) +{ + + SIZE_T i, j; + SIZE_T x, y; + SIZE_T k; + +// unsharp's constants +#ifdef __UNSHARP_WLO__ +#pragma EXPLORE_FIX W={7..16} I={5} +const DTYPE coeff[3][3] = { { 0.299f, 0.587f, 0.114f}, {-0.168736f, -0.331264f, 0.5f}, {0.5f, -0.418688f, -0.081312f}}; +#pragma EXPLORE_FIX W={7..16} I={5} +const DTYPE coefb[3][3] = {{1.0f, 0.0f, 1.402f}, {1.0f, -0.34414f, -0.71414f}, {1.0f, 1.772f, 0.0f}}; +#pragma EXPLORE_FIX W={7..16} I={5} +const double CST_1 = 0.858823529; +#pragma EXPLORE_FIX W={7..16} I={5} +const double CST_2 = 0.062745098; +#pragma EXPLORE_FIX W={7..16} I={5} +const double CST_3 = 1.164383562; +#pragma EXPLORE_FIX W={7..16} I={5} +const double CST_4 = 0.073059361; + +#pragma EXPLORE_FIX W={7..16} I={5} +// #pragma EXPLORE_CONSTRAINT SAME= blur_v + DTYPE filt_tmp[7]; + +#pragma EXPLORE_CONSTRAINT SAME = in_unsharpf + DTYPE tmp_in_1; +#pragma EXPLORE_CONSTRAINT SAME = in_unsharpf + DTYPE tmp_in_2; +#pragma EXPLORE_CONSTRAINT SAME= in_unsharpf + DTYPE tmp_in_3; +#pragma EXPLORE_CONSTRAINT SAME= out_unsharpf + DTYPE tmp_out_1; +#pragma EXPLORE_CONSTRAINT SAME= out_unsharpf + DTYPE tmp_out_2; +#pragma EXPLORE_CONSTRAINT SAME= out_unsharpf + DTYPE tmp_out_3; +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE mask; +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE blur_v; +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE blur_h; +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE g; +#pragma EXPLORE_FIX W={7..16} I={5} + DTYPE l_full; + +#else + const DTYPE coeff[3][3] = { { 0.299f, 0.587f, 0.114f}, {-0.168736f, -0.331264f, 0.5f}, {0.5f, -0.418688f, -0.081312f}}; + const DTYPE coefb[3][3] = {{1.0f, 0.0f, 1.402f}, {1.0f, -0.34414f, -0.71414f}, {1.0f, 1.772f, 0.0f}}; + const double CST_1 = 0.858823529; + const double CST_2 = 0.062745098; + const double CST_3 = 1.164383562; + const double CST_4 = 0.073059361; + + DTYPE filt_tmp[7]; + DTYPE tmp_in_1, tmp_in_2, tmp_in_3; + DTYPE tmp_out_1, tmp_out_2, tmp_out_3; + DTYPE mask; + DTYPE blur_v; + DTYPE blur_h; + DTYPE g; + DTYPE l_full; +#endif + + for(i = 0; i<W*(H+3); i++) + { + y = i/(H+3); + x = i%(H+3); + blur_v = 0.0; + // Vertical blur pass and Convert RGB to YCbCr + if(x<H) // from 0 to H-1 + { + if((y>0) && (y<W-3)) + { + tmp_in_1 = in_unsharpf[(y+3)*H+x]; + tmp_in_2 = in_unsharpf[(y+3)*H+x+W*H]; + tmp_in_3 = in_unsharpf[(y+3)*H+x+2*W*H]; + + in_unsharpf[(y+3)*H+x] = (tmp_in_1*coeff[0][0] + tmp_in_2*coeff[0][1] + tmp_in_3*coeff[0][2]) * CST_1 + CST_2; + in_unsharpf[(y+3)*H+x+W*H] = tmp_in_1*coeff[1][0] + tmp_in_2*coeff[1][1] + tmp_in_3*coeff[1][2]; + in_unsharpf[(y+3)*H+x+2*W*H] = tmp_in_1*coeff[2][0] + tmp_in_2*coeff[2][1] + tmp_in_3*coeff[2][2]; + } + for(k = 0; k<HSIZE; k++) + { + j = y + k; + // j = x + k; + j = j <= HSIZE/2 ? 0 : j-HSIZE/2; + j = j >= W ? W-1 : j; + + // Convert RGB to YCbCr + if((y==0) && ((k==0) || (k>3))) + { + tmp_in_1 = in_unsharpf[j*H+x]; + tmp_in_2 = in_unsharpf[j*H+x+W*H]; + tmp_in_3 = in_unsharpf[j*H+x+2*W*H]; + + in_unsharpf[j*H+x] = (tmp_in_1*coeff[0][0] + tmp_in_2*coeff[0][1] + tmp_in_3*coeff[0][2]) * CST_1 + CST_2; + in_unsharpf[j*H+x+W*H] = tmp_in_1*coeff[1][0] + tmp_in_2*coeff[1][1] + tmp_in_3*coeff[1][2]; + in_unsharpf[j*H+x+2*W*H] = tmp_in_1*coeff[2][0] + tmp_in_2*coeff[2][1] + tmp_in_3*coeff[2][2]; + } + blur_v += in_unsharpf[j*H+x]*f_unsharpf[k]; + // blur_v += in_unsharpf[y*H+j]*f_unsharpf[k]; + } + filt_tmp[x%7] = blur_v; + } + + blur_h = 0.0; + // Horizontal blur pass and Convert YCbCr to RGB + if(x>2) // from 3 to H+2 + { + // Horizontal blur pass + for(k = 0; k<HSIZE; k++) + { + j = x + k - 3; // because we are calculating for the index i-3 + j = j <= HSIZE/2 ? 0 : j-HSIZE/2; + j = j >= H ? H-1 : j; + blur_h += filt_tmp[j%7]*f_unsharpf[k]; + } + + // MASK function + g = in_unsharpf[i-3*(y+1)] - blur_h; + + if((g <= thr_unsharpf) && (g>=-thr_unsharpf)) { + g = 0; + } + mask = in_unsharpf[i-3*(y+1)] + amount_unsharpf*g; + if(mask < (0.0)) mask = (0.0); + if(mask > (1.0)) mask = (1.0); + + // Convert YCbCr to RGB + l_full = (mask * CST_3 - CST_4); + tmp_out_1 = l_full*coefb[0][0] + in_unsharpf[i-3*(y+1)+W*H]*coefb[0][1] + in_unsharpf[i-3*(y+1)+2*W*H]*coefb[0][2]; + if (tmp_out_1 < (0.0)) tmp_out_1 = (0.0); + if (tmp_out_1 > (1.0)) tmp_out_1 = (1.0); + out_unsharpf[i-3*(y+1)] = tmp_out_1; + + tmp_out_2 = l_full*coefb[1][0] + in_unsharpf[i-3*(y+1)+W*H]*coefb[1][1] + in_unsharpf[i-3*(y+1)+2*W*H]*coefb[1][2]; + if (tmp_out_2 < (0.0)) tmp_out_2 = (0.0); + if (tmp_out_2 > (1.0)) tmp_out_2 = (1.0); + out_unsharpf[(i-3*(y+1))+W*H] = tmp_out_2; + + tmp_out_3 = l_full*coefb[2][0] + in_unsharpf[i-3*(y+1)+W*H]*coefb[2][1] + in_unsharpf[i-3*(y+1)+2*W*H]*coefb[2][2]; + if (tmp_out_3 < (0.0)) tmp_out_3 = (0.0); + if (tmp_out_3 > (1.0)) tmp_out_3 = (1.0); + out_unsharpf[(i-3*(y+1))+2*W*H] = tmp_out_3; + + } + } +} + + + +#pragma MAIN_FUNC +void isp_core( + DTYPE in_nlm[H][W], + DTYPE out_nlm[H][W], + DTYPE filt_matrix[H][W], + DTYPE mat_in_pad[SIZE_H_PAD][SIZE_W_PAD], + DTYPE in_pad_nlm[SIZE_H_FIL_3][SIZE_W_FIL_3], + DTYPE_DOUBLE mat_sqdiff[SIZE_H_REF][SIZE_W_REF], + DTYPE mat_acc_weight[H][W], + DTYPE out_linear[H][W], + DTYPE out_wb[H][W], + DTYPE r_dc[H][W], + DTYPE g_dc[H][W], + DTYPE b_dc[H][W], + DTYPE out_dc[3*H*W], + DTYPE gh[H][W], + DTYPE gv[H][W], + DTYPE tmp_dc_0[H][W], + DTYPE tmp_dc_1[H][W], + DTYPE tmp_dc_2[H][W], + DTYPE tmp_dc_3[H][W], + DTYPE tmp_dc_4[H][W], + DTYPE in_pad_gh[SIZE_H_FIL_5][SIZE_W_FIL_5], + DTYPE in_pad_gv[SIZE_H_FIL_5][SIZE_W_FIL_5], + DTYPE in_pad_tmp_dc_0[SIZE_H_FIL_3][SIZE_W_FIL_3], + DTYPE in_pad_tmp_dc_1[SIZE_H_FIL_5][SIZE_W_FIL_5], + DTYPE in_pad_tmp_dc_2[SIZE_H_FIL_5][SIZE_W_FIL_5], + DTYPE in_pad_tmp_dc_3[SIZE_H_FIL_3][SIZE_W_FIL_3], + DTYPE in_pad_tmp_dc_4[SIZE_H_FIL_3][SIZE_W_FIL_3], + DTYPE out_cc[3*H*W], + DTYPE out_gbc[3*H*W], + DTYPE tmp_abc[3*H*W], + DTYPE out_unsharp[3*H*W], + DTYPE out_unsharp_r[H][W], + DTYPE out_unsharp_g[H][W], + DTYPE out_unsharp_b[H][W], + + DTYPE matrix_shape[H3][W] +) +{ + // Variables declarations + int i,j,k; // counter variables + + // nlm + DTYPE np1; + DTYPE np2; + DTYPE thr_nlm; + DTYPE black1; + DTYPE black2; + + bayer_type type = bggr; + + // Unsharp + DTYPE amount; + DTYPE thr_unsharp; + DTYPE radius; + + // DTYPE out_unsharp[3*H*W]; + + +#ifdef __GECOS_TYPE_EXPL__ + DTYPE filter[HSIZE]; + + $inject(in_nlm, $random_uniform(0, 1, 3)); + $inject(filter, $random_uniform(0, 1, 2)); + $inject(np1, $from_var(0.00152334432)); + $inject(np2, $from_var(9.92565509172e-006)); + $inject(thr_nlm, $from_var(0.4)); + $inject(black1, $from_var(64.0/1023.0)); + $inject(black2, $from_var(64.0/1023.0)); + $inject(thr_unsharp, $from_var(0.01)); + $inject(amount, $from_var(1.2)); + $inject(radius, $from_var(1.5)); +#else + char input_img[32]; + char output_img[32]; + + double *data_in; + data_in = (double*)malloc(H*W*sizeof(double)); + + + np1 = 0.00152334432; + np2 = 9.92565509172e-006; + thr_nlm = 0.4; + black1 = 64.0/1023.0; + black2 = 64.0/1023.0; + + thr_unsharp = 0.01; + amount = 1.2; + radius = 1.5; + // Define the Gaussian blur filter + SIZE_T hsize = 2*ceil(2*radius)+1; + hsize = hsize < 3 ? 3 : hsize; + DTYPE *filter; + filter = (DTYPE*)malloc(hsize*sizeof(DTYPE)); + DTYPE norm = 0; + for (SIZE_T i=0; i<hsize; ++i) { + double k = (double)i-hsize/2; + DTYPE tmp = exp(-(k*k)/(2*radius*radius)); + norm += tmp; + filter[i] = tmp; + } + for (SIZE_T i=0; i<hsize; ++i) { + filter[i] = filter[i]/norm; + } + + sprintf(input_img, "./input_nlm_acc.bin"); + read_image(input_img, H, W, data_in); + + for (i=0; i < H; i++) + { + for (j=0; j < W; j++) + { + in_nlm[i][j] = data_in[i+j*H]; + } + } +#endif + + nlm(out_nlm, in_nlm, filt_matrix, mat_in_pad, in_pad_nlm, mat_sqdiff, mat_acc_weight, np1, np2, thr_nlm, black1); + linearize(out_nlm, out_linear, black2); + wb(out_linear, out_wb, type); + demmhc(out_wb, out_dc, type, r_dc, g_dc, b_dc, gh, gv, tmp_dc_0, tmp_dc_1, tmp_dc_2, tmp_dc_3, tmp_dc_4, in_pad_gh, in_pad_gv, in_pad_tmp_dc_0, in_pad_tmp_dc_1,in_pad_tmp_dc_2, in_pad_tmp_dc_3, in_pad_tmp_dc_4); + color_correction(out_dc, out_cc); + gamma_bright_correction(out_cc, out_gbc); + + for(k=0; k<3; k++) + { + for (i=0; i < H; i++) + { + for (j=0; j < W; j++) + { + tmp_abc[i+j*H + k*H*W] = out_gbc[i*W+j + k*H*W]; + } + } + } + + unsharpf(tmp_abc, out_unsharp, filter, amount, thr_unsharp); + + + for (i=0; i < H; i++) + { + for (j=0; j < W; j++) + { + out_unsharp_r[i][j] = out_unsharp[i*W+j]; + out_unsharp_g[i][j] = out_unsharp[i*W+j + H*W]; + out_unsharp_b[i][j] = out_unsharp[i*W+j + 2*H*W]; + } + } + + for(k=0; k<3; k++) + { + for(i=0; i<H; i++) + { + for(j=0; j<W; j++) + { + matrix_shape[k*H+i][j] = out_unsharp[i+j*H + k*H*W]; + } + } + } + + +#ifdef __GECOS_TYPE_EXPL__ + $save(matrix_shape, H3, W); +#endif + +#ifndef __GECOS_TYPE_EXPL__ + double *data_out; + data_out = (double*)malloc(3*H*W*sizeof(double)); + + for (k=0; k<3; k++) + for (i=0; i<H; i++) + for (j=0; j<W; j++) + data_out[i+j*H + k*H*W] = (double)out_unsharp[i+j*H + k*H*W]; + // data_out[i+j*H + k*H*W] = (double)out_gbc[i*W+j + k*H*W]; + + sprintf(output_img, "./data_out.bin"); + write_image(output_img, 3*H, W, data_out); +#endif + +#ifndef __GECOS_TYPE_EXPL__ + free(data_in); + free(data_out); + free(filter); +#endif +} + +#ifndef __GECOS_TYPE_EXPL__ +int main(int argc, char * * argv) { + DTYPE (* in_nlm)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* out_nlm)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + + DTYPE (* filt_matrix)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* mat_in_pad)[SIZE_W_PAD] = (DTYPE (*)[SIZE_W_PAD])malloc(sizeof (DTYPE)*SIZE_H_PAD*SIZE_W_PAD); + DTYPE (* in_pad_nlm)[SIZE_W_FIL_3] = (DTYPE (*)[SIZE_W_FIL_3])malloc(SIZE_H_FIL_3*SIZE_W_FIL_3*sizeof(DTYPE)); + DTYPE_DOUBLE (* mat_sqdiff)[SIZE_W_REF] = (DTYPE_DOUBLE (*)[SIZE_W_REF])malloc(sizeof (DTYPE_DOUBLE)*SIZE_H_REF*SIZE_W_REF); + DTYPE (* mat_acc_weight)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + + DTYPE (* out_linear)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* out_wb)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* r_dc)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* g_dc)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* b_dc)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE * out_dc = (DTYPE *)malloc(sizeof (DTYPE) * (3*H*W)); + DTYPE (* gh)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* gv)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* tmp_dc_0)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* tmp_dc_1)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* tmp_dc_2)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* tmp_dc_3)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* tmp_dc_4)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* in_pad_gh)[W + 4] = (DTYPE (*)[W + 4])malloc(sizeof (DTYPE) * (H + 4) * (W + 4)); + DTYPE (* in_pad_gv)[W + 4] = (DTYPE (*)[W + 4])malloc(sizeof (DTYPE) * (H + 4) * (W + 4)); + DTYPE (* in_pad_tmp_dc_0)[W + 2] = (DTYPE (*)[W + 2])malloc(sizeof (DTYPE) * (H + 2) * (W + 2)); + DTYPE (* in_pad_tmp_dc_1)[W + 4] = (DTYPE (*)[W + 4])malloc(sizeof (DTYPE) * (H + 4) * (W + 4)); + DTYPE (* in_pad_tmp_dc_2)[W + 4] = (DTYPE (*)[W + 4])malloc(sizeof (DTYPE) * (H + 4) * (W + 4)); + DTYPE (* in_pad_tmp_dc_3)[W + 2] = (DTYPE (*)[W + 2])malloc(sizeof (DTYPE) * (H + 2) * (W + 2)); + DTYPE (* in_pad_tmp_dc_4)[W + 2] = (DTYPE (*)[W + 2])malloc(sizeof (DTYPE) * (H + 2) * (W + 2)); + DTYPE * out_cc = (DTYPE *)malloc(sizeof (DTYPE) * (3*H*W)); + DTYPE * out_gbc = (DTYPE *)malloc(sizeof (DTYPE) * (3*H*W)); + DTYPE * tmp_abc = (DTYPE *)malloc(sizeof (DTYPE) * (3*H*W)); + DTYPE * out_unsharp = (DTYPE *)malloc(sizeof (DTYPE) * (3*H*W)); + DTYPE (* out_unsharp_r)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* out_unsharp_g)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + DTYPE (* out_unsharp_b)[W] = (DTYPE (*)[W])malloc(sizeof (DTYPE)*H*W); + + DTYPE (* matrix_shape)[W] = (DTYPE (*)[W])malloc(sizeof(DTYPE) *3*H*W); + + isp_core(in_nlm, out_nlm, filt_matrix, mat_in_pad, in_pad_nlm, mat_sqdiff, mat_acc_weight, out_linear, out_wb, r_dc, g_dc, b_dc, out_dc, gh, gv, tmp_dc_0, tmp_dc_1, tmp_dc_2, tmp_dc_3, tmp_dc_4, in_pad_gh, in_pad_gv, in_pad_tmp_dc_0, in_pad_tmp_dc_1, in_pad_tmp_dc_2, in_pad_tmp_dc_3, in_pad_tmp_dc_4, out_cc, out_gbc, tmp_abc, out_unsharp, out_unsharp_r, out_unsharp_g, out_unsharp_b, matrix_shape); + // isp_core(in_nlm, out_nlm, filt_matrix, mat_in_pad, in_pad_nlm, mat_sqdiff, mat_acc_weight, out_unsharp_r, out_unsharp_g, out_unsharp_b); + + + + free(in_nlm); + free(out_nlm); + free(filt_matrix); + free(mat_in_pad); + free(in_pad_nlm); + free(mat_sqdiff); + free(mat_acc_weight); + free(out_linear); + free(out_wb); + free(r_dc); + free(g_dc); + free(b_dc); + free(out_dc); + free(gh); + free(gv); + free(tmp_dc_0); + free(tmp_dc_1); + free(tmp_dc_2); + free(tmp_dc_3); + free(tmp_dc_4); + free(in_pad_gh); + free(in_pad_gv); + free(in_pad_tmp_dc_0); + free(in_pad_tmp_dc_1); + free(in_pad_tmp_dc_2); + free(in_pad_tmp_dc_3); + free(in_pad_tmp_dc_4); + free(out_cc); + free(out_gbc); + free(tmp_abc); + free(out_unsharp); + free(out_unsharp_r); + free(out_unsharp_g); + free(out_unsharp_b); + + free(matrix_shape); + return 0; +} + +#endif + + diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/src-c/utils.c b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/src-c/utils.c new file mode 100644 index 0000000000000000000000000000000000000000..d179ac670318294d987c4888b1734542733e8da0 --- /dev/null +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/src-c/utils.c @@ -0,0 +1,23 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +void read_image(const char image[], int nrOfRows, int nrOfColumns, double *data){ + FILE *fp; + fp = fopen(image , "rb" ); + fread(data, sizeof(double), nrOfRows*nrOfColumns, fp); + fclose(fp); +} + +void write_image(const char image[], int nrOfRows, int nrOfColumns, double *data){ + FILE *fp; + fp = fopen(image , "wb" ); + if(fp == NULL) + { + puts("Cannot open file!"); + exit(1); + } + fwrite(data, sizeof(double), nrOfRows*nrOfColumns, fp); + fclose(fp); +} + diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/src-c/utils.h b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/src-c/utils.h new file mode 100644 index 0000000000000000000000000000000000000000..55df622804b0fc738b8a39c759c45aab6e454bb7 --- /dev/null +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/src-c/utils.h @@ -0,0 +1,8 @@ +#ifndef UTILS_H +#define UTILS_H + +void read_image(const char image[], int nrOfRows, int nrOfColumns, double *data); +void write_image(const char image[], int nrOfRows, int nrOfColumns, double *data); + +#endif//UTILS_H + diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/test_isp.cs b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/test_isp.cs new file mode 100644 index 0000000000000000000000000000000000000000..f2b9b1179aa46bd658e5b3b49603bd62fc2d0fbf --- /dev/null +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/isp_fixed/test_isp.cs @@ -0,0 +1,13 @@ +debug(2); + +sourceDir = "src-c/"; + +p = CreateGecosProject("isp_fixed"); +AddSourceToGecosProject(p, sourceDir + "isp_core.c"); +AddSourceToGecosProject(p, sourceDir + "utils.c"); +AddIncDirToGecosProject(p, sourceDir); + +#TypesExploration("."); #regenearate default.properties +TypesExploration(p, "default.properties", "isp_fixed.costdsl"); +#TypesExploration(p, "default.properties"); + diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm/default.properties b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm/default.properties index 08c046925860f8fd73469dd5ae84dd493b7f6dd5..c0a0b72cdc45f328a1f13950a362997a9275a7e8 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm/default.properties +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm/default.properties @@ -1,13 +1,37 @@ +# Compiler used during profiling. The current simulation based profiler assumes gcc/g++ options are accepted. +# Default value: g++ +CC = g++ + +# Additional compiler flags to be used during profiling runs. +# Default value: -O2 -Wno-everything +EXTRA_CFLAGS = -O2 -Wno-everything + +# Path to DSL that specify model of computation used in cost models. +# Default value: +COST_MODEL_DSL = + +# Additional flags to be used for cost models. Use group=<group name> to specify a pre-defined group to include in the cost calculation. +# Default value: +COST_MODEL_FLAGS = + # Max number of threads to be used: Positive integer value or C to match available Processors # Default value: C nbThreads = C -# Logging level for the main logger: [SEVERE, WARNING, INFO, FINE, ALL] -# Default value: INFO -mainLogLevel = INFO +# Number of times a simulation is repeated.Main usage is to inject content of different files as inputs. +# Default value: 1 +nbSimulations = 1 + +# If false no charts will be created/displayed during exploration: [true, false] +# Default value: true +enableCharts = true -# Logging level for the exploration logger: [SEVERE, WARNING, INFO, FINE, ALL] -# Default value: INFO +# Logging level for the main logger: [OFF, SEVERE, WARNING, CONFIG, INFO, FINE, FINER, FINEST, ALL] +# Default value: ALL +mainLogLevel = ALL + +# Logging level for the exploration logger: [OFF, SEVERE, WARNING, CONFIG, INFO, FINE, FINER, FINEST, ALL] +# Default value: ALL explorationLogLevel = ALL # Exploration Mode: [FIXED, FLOAT, MIXED] @@ -29,25 +53,40 @@ nbOutputsToKeep = 3 # Default value: false pruneFirst = false -# Exploration algorithm: [BRUTE_FORCE, MIN_PLUS_ONE, TABU_SEARCH] -# Default value: MIN_PLUS_ONE +# Exploration algorithm: [BRUTE_FORCE, MIN_PLUS_ONE, TABU_SEARCH, ENUMERATION] +# Default value: TABU_SEARCH explorationAlgo = TABU_SEARCH -# Accuracy metric: [MAX_ABS_ERR, PSNR, PSNR_DB, POWER, POWER_DB] +# Additional flags to be used by specific exploration algorithms. Available options depend on the algorithm. +# Default value: +explorationFlags = + +# Comma-separated Accuracy metrics: [MAX_ABS_ERR, PSNR, PSNR_DB, POWER, POWER_DB, SSIM] # MAX_ABS_ERR: Maximum Absolute Error. Higher values are less accurate # PSNR: Peak Signal to Noise Ratio. Higher values are more accurate # PSNR_DB: Peak Signal to Noise Ratio in dB. Higher values are more accurate # POWER: Noise Power. Higher values are less accurate # POWER_DB: Noise Power in dB. Higher values are less accurate +# SSIM: Structural Similarity (SSIM). Higher values are more accurate # Default value: PSNR_DB accuracyMetric = PSNR_DB -# Threshold value of the specified Accuracy Metric. It's considered as a Lower (Upper) bound if higher values -of the specified metric- are considered more (less) accurate +# Comma-separated Threshold values of the corresponding Accuracy Metrics (in the same order). It's considered as a Lower (Upper) bound if higher values -of the specified metric- are considered more (less) accurate # Default value: 40 -accuracyThreshold = 70 +accuracyThreshold = 40 + +# Structural Similarity is used as an additional accuracy metric when enabled. +# Default value: false +SSIMenabled = false + +# Variable name to be used for SSIM calculation. +# Default value: +SSIMtarget = -# Cost metric: [SUM_W] +# Comma-separated Cost metrics: [SUM_W, AREA_MODEL, ENERGY_MODEL] # SUM_W: The sum of wordlengths of all Symbols. Higher values are more costly +# AREA_MODEL: Simple area cost estimation based on a model of computation. Higher values are more costly +# ENERGY_MODEL: Simple energy estimation based on a model of computation. Higher values are more costly # Default value: SUM_W costMetric = SUM_W @@ -65,21 +104,23 @@ snapshotsErrorMerge = MEAN # Default value: CONCAT symbolsErrorMerge = CONCAT -# The default wordlength values to use for Symbols without EXPLORE_FIX pragma: Comma-separated Positive integer values +# The default wordlength values to use for Symbols without EXPLORE_FIX pragma: Comma-separated, Positive integer value or value range (min..max) # Default value: 32 defaultFixedW = 32 -# The default integer-part-length values to use for Symbols without EXPLORE_FIX pragma: Comma-separated Positive integer value +# The default integer-part-length values to use for Symbols without EXPLORE_FIX pragma: Comma-separated, Positive integer value or value range (min..max) # Default value: 16 defaultFixedI = 16 -# The default wordlength values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated Positive integer value +# The default wordlength values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated, Positive integer value or value range (min..max) # Default value: 32 defaultFloatW = 32 -# The default exponent length values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated Positive integer value +# The default exponent length values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated, Positive integer value or value range (min..max) # Default value: 8 defaultFloatE = 8 -enableCharts = true +# Set to 1 if the values are signed by default, 0 otherwise. +# Default value: 1 +defaultSigned = 1 diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm/src-c/utils.c b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm/src-c/utils.c index 8c51f02b2408b4b39cd6e01801f033a773b4712f..f533b4cc65ec4c2ad072eae45f436e48d3bec8e0 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm/src-c/utils.c +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm/src-c/utils.c @@ -5,7 +5,9 @@ void read_image(const char image[], int nrOfRows, int nrOfColumns, double *data){ FILE *fp; fp = fopen(image , "rb" ); - fread(data, sizeof(double), nrOfRows*nrOfColumns, fp); + if (fread(data, sizeof(double), nrOfRows*nrOfColumns, fp) != nrOfRows*nrOfColumns) { + printf("error :: problem occurred when reading file %s\n", image); + } fclose(fp); } @@ -17,6 +19,8 @@ void write_image(const char image[], int nrOfRows, int nrOfColumns, double *data puts("Cannot open file!"); exit(1); } - fwrite(data, sizeof(double), nrOfRows*nrOfColumns, fp); + if (fwrite(data, sizeof(double), nrOfRows*nrOfColumns, fp) != nrOfRows*nrOfColumns) { + printf("error :: problem occurred when writing file %s\n", image); + } fclose(fp); } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/exploration.properties b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/exploration.properties index 99b8426ed55e180621898e3864d506541a6116b1..5f748cc22b041503df303f0aeb4be56792442812 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/exploration.properties +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/exploration.properties @@ -2,6 +2,18 @@ # Default value: C nbThreads = C +# Additional compiler flags to be used during profiling runs. +# Default value: +EXTRA_CFLAGS = + +# Path to DSL that specify model of computation used in cost models. +# Default value: +COST_MODEL_DSL = nlm_png.costdsl + +# Additional flags to be used for cost models. Use group=<group name> to specify a pre-defined group to include in the cost calculation. +# Default value: +COST_MODEL_FLAGS = + # Number of times a simulation is repeated.Main usage is to inject content of different files as inputs. # Default value: 1 nbSimulations = 1 diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/nlm_png.costdsl b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/nlm_png.costdsl index 2a2139917683b8ee2d91574219ab2b20fbe64447..09afa25ced24d039a3c246a7b6789b64b06f4cdf 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/nlm_png.costdsl +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/nlm_png.costdsl @@ -6,6 +6,9 @@ target { outputsPerCycle = 2 problemSize = H W } +group ADDonly {nlmADD} +group MULonly {nlmMUL} + block nlmADD { ADD : mat_in_pad = mat_in_pad op mat_in_pad x 2 H W; diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/test_nlm_png.cs b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/test_nlm_png.cs index 16d03b24f7eeb1327207595519efe638ec546a9e..2585f5046f23d49a692b9fb31002d31553bde2b3 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/test_nlm_png.cs +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/test_nlm_png.cs @@ -9,5 +9,4 @@ AddIncDirToGecosProject(p, sourceDir); #TypesExploration("."); #regenearate default.properties -#TypesExploration(p, "exploration.properties"); -TypesExploration(p, "exploration.properties", "nlm_png.costdsl"); +TypesExploration(p, "exploration.properties"); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.wizard/META-INF/MANIFEST.MF b/bundles/fr.irisa.cairn.gecos.typeexploration.wizard/META-INF/MANIFEST.MF index 618f8191cf1405a639877172d26402cf96e31d3d..60b5bfc6dd778fcd3b9fdebab27e52c635c7d555 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.wizard/META-INF/MANIFEST.MF +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.wizard/META-INF/MANIFEST.MF @@ -2,6 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Type Exploration Wizard Bundle-SymbolicName: fr.irisa.cairn.gecos.typeexploration.wizard;singleton:=true +Automatic-Module-Name: fr.irisa.cairn.gecos.typeexploration.wizard Bundle-Version: 1.0.0.qualifier Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.wizard/resources/wizard_templates/fixed_point_exploration/exploration.properties b/bundles/fr.irisa.cairn.gecos.typeexploration.wizard/resources/wizard_templates/fixed_point_exploration/exploration.properties index 700b5296c2c27e7c2f5d78baefcead99a46adb7c..76bbe86a69ab66cbe189607c58f57a45de1a8203 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.wizard/resources/wizard_templates/fixed_point_exploration/exploration.properties +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.wizard/resources/wizard_templates/fixed_point_exploration/exploration.properties @@ -2,15 +2,23 @@ # Default value: C nbThreads = C +# Number of times a simulation is repeated.Main usage is to inject content of different files as inputs. +# Default value: 1 +nbSimulations = 1 + +# If false no charts will be created/displayed during exploration: [true, false] +# Default value: true +enableCharts = true + # Logging level for the main logger: [SEVERE, WARNING, INFO, FINE, ALL] -# Default value: INFO -mainLogLevel = INFO +# Default value: ALL +mainLogLevel = ALL # Logging level for the exploration logger: [SEVERE, WARNING, INFO, FINE, ALL] -# Default value: INFO -explorationLogLevel = INFO +# Default value: ALL +explorationLogLevel = ALL -# Exploaration Mode: [FIXED, FLOAT, MIXED] +# Exploration Mode: [FIXED, FLOAT, MIXED] # FIXED: Explore only fixed-point types # FLOAT: Explore only custom floating-point types # MIXED: Explore both floating-point and fixed-point types. This mode is not unsupported yet ! @@ -29,25 +37,38 @@ nbOutputsToKeep = 3 # Default value: false pruneFirst = false -# Exploration algorithm: [BRUTE_FORCE, MIN_PLUS_ONE] -# Default value: MIN_PLUS_ONE +# Exploration algorithm: [BRUTE_FORCE, MIN_PLUS_ONE, TABU_SEARCH] +# Default value: TABU_SEARCH explorationAlgo = BRUTE_FORCE -# Accuracy metric: [MAX_ABS_ERR, PSNR, PSNR_DB, POWER, POWER_DB] +# Comma-separated Accuracy metrics: [MAX_ABS_ERR, PSNR, PSNR_DB, POWER, POWER_DB, SSIM] # MAX_ABS_ERR: Maximum Absolute Error. Higher values are less accurate # PSNR: Peak Signal to Noise Ratio. Higher values are more accurate # PSNR_DB: Peak Signal to Noise Ratio in dB. Higher values are more accurate # POWER: Noise Power. Higher values are less accurate # POWER_DB: Noise Power in dB. Higher values are less accurate +# SNR: Signal to Noise Ratio. Higher values are more accurate +# SNR_DB: Signal to Noise Ratio in dB. Higher values are more accurate +# SSIM: Structural Similarity (SSIM). Higher values are more accurate # Default value: PSNR_DB accuracyMetric = PSNR_DB -# Threshold value of the specified Accuracy Metric. It's considered as a Lower (Upper) bound if higher values -of the specified metric- are considered more (less) accurate +# Comma-separated Threshold values of the corresponding Accuracy Metrics (in the same order). It's considered as a Lower (Upper) bound if higher values -of the specified metric- are considered more (less) accurate # Default value: 40 -accuracyThreshold = 30 +accuracyThreshold = 40 + +# Structural Similarity is used as an additional accuracy metric when enabled. +# Default value: false +SSIMenabled = false + +# Variable name to be used for SSIM calculation. +# Default value: +SSIMtarget = -# Cost metric: [SUM_W] +# Comma-separated Cost metrics: [SUM_W, AREA_MODEL, ENERGY_MODEL] # SUM_W: The sum of wordlengths of all Symbols. Higher values are more costly +# AREA_MODEL: Simple area cost estimation based on a model of computation. Higher values are more costly +# ENERGY_MODEL: Simple energy estimation based on a model of computation. Higher values are more costly # Default value: SUM_W costMetric = SUM_W @@ -65,18 +86,23 @@ snapshotsErrorMerge = MEAN # Default value: CONCAT symbolsErrorMerge = CONCAT -# The default wordlength values to use for Symbols without EXPLORE_FIX pragma: Comma-separated Positive integer values +# The default wordlength values to use for Symbols without EXPLORE_FIX pragma: Comma-separated, Positive integer value or value range (min..max) # Default value: 32 defaultFixedW = 32 -# The default integer-part-length values to use for Symbols without EXPLORE_FIX pragma: Comma-separated Positive integer value +# The default integer-part-length values to use for Symbols without EXPLORE_FIX pragma: Comma-separated, Positive integer value or value range (min..max) # Default value: 16 defaultFixedI = 16 -# The default wordlength values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated Positive integer value +# The default wordlength values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated, Positive integer value or value range (min..max) # Default value: 32 defaultFloatW = 32 -# The default exponent length values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated Positive integer value +# The default exponent length values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated, Positive integer value or value range (min..max) # Default value: 8 defaultFloatE = 8 + +# Set to 1 if the values are signed by default, 0 otherwise. +# Default value: 1 +defaultSigned = 1 + diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration.wizard/resources/wizard_templates/floating_point_exploration/exploration.properties b/bundles/fr.irisa.cairn.gecos.typeexploration.wizard/resources/wizard_templates/floating_point_exploration/exploration.properties index 9b00ce2e02647b28c10b48b3f18cc3e53e15fb71..143b2c1494d0bcaca1742077f8bba3b237b7d2b6 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration.wizard/resources/wizard_templates/floating_point_exploration/exploration.properties +++ b/bundles/fr.irisa.cairn.gecos.typeexploration.wizard/resources/wizard_templates/floating_point_exploration/exploration.properties @@ -2,15 +2,23 @@ # Default value: C nbThreads = C +# Number of times a simulation is repeated.Main usage is to inject content of different files as inputs. +# Default value: 1 +nbSimulations = 1 + +# If false no charts will be created/displayed during exploration: [true, false] +# Default value: true +enableCharts = true + # Logging level for the main logger: [SEVERE, WARNING, INFO, FINE, ALL] -# Default value: INFO -mainLogLevel = INFO +# Default value: ALL +mainLogLevel = ALL # Logging level for the exploration logger: [SEVERE, WARNING, INFO, FINE, ALL] -# Default value: INFO -explorationLogLevel = INFO +# Default value: ALL +explorationLogLevel = ALL -# Exploaration Mode: [FIXED, FLOAT, MIXED] +# Exploration Mode: [FIXED, FLOAT, MIXED] # FIXED: Explore only fixed-point types # FLOAT: Explore only custom floating-point types # MIXED: Explore both floating-point and fixed-point types. This mode is not unsupported yet ! @@ -29,25 +37,38 @@ nbOutputsToKeep = 3 # Default value: false pruneFirst = false -# Exploration algorithm: [BRUTE_FORCE, MIN_PLUS_ONE] -# Default value: MIN_PLUS_ONE +# Exploration algorithm: [BRUTE_FORCE, MIN_PLUS_ONE, TABU_SEARCH] +# Default value: TABU_SEARCH explorationAlgo = BRUTE_FORCE -# Accuracy metric: [MAX_ABS_ERR, PSNR, PSNR_DB, POWER, POWER_DB] +# Comma-separated Accuracy metrics: [MAX_ABS_ERR, PSNR, PSNR_DB, POWER, POWER_DB, SSIM] # MAX_ABS_ERR: Maximum Absolute Error. Higher values are less accurate # PSNR: Peak Signal to Noise Ratio. Higher values are more accurate # PSNR_DB: Peak Signal to Noise Ratio in dB. Higher values are more accurate # POWER: Noise Power. Higher values are less accurate # POWER_DB: Noise Power in dB. Higher values are less accurate +# SNR: Signal to Noise Ratio. Higher values are more accurate +# SNR_DB: Signal to Noise Ratio in dB. Higher values are more accurate +# SSIM: Structural Similarity (SSIM). Higher values are more accurate # Default value: PSNR_DB accuracyMetric = PSNR_DB -# Threshold value of the specified Accuracy Metric. It's considered as a Lower (Upper) bound if higher values -of the specified metric- are considered more (less) accurate +# Comma-separated Threshold values of the corresponding Accuracy Metrics (in the same order). It's considered as a Lower (Upper) bound if higher values -of the specified metric- are considered more (less) accurate # Default value: 40 -accuracyThreshold = 30 +accuracyThreshold = 40 + +# Structural Similarity is used as an additional accuracy metric when enabled. +# Default value: false +SSIMenabled = false + +# Variable name to be used for SSIM calculation. +# Default value: +SSIMtarget = -# Cost metric: [SUM_W] +# Comma-separated Cost metrics: [SUM_W, AREA_MODEL, ENERGY_MODEL] # SUM_W: The sum of wordlengths of all Symbols. Higher values are more costly +# AREA_MODEL: Simple area cost estimation based on a model of computation. Higher values are more costly +# ENERGY_MODEL: Simple energy estimation based on a model of computation. Higher values are more costly # Default value: SUM_W costMetric = SUM_W @@ -65,18 +86,23 @@ snapshotsErrorMerge = MEAN # Default value: CONCAT symbolsErrorMerge = CONCAT -# The default wordlength values to use for Symbols without EXPLORE_FIX pragma: Comma-separated Positive integer values +# The default wordlength values to use for Symbols without EXPLORE_FIX pragma: Comma-separated, Positive integer value or value range (min..max) # Default value: 32 defaultFixedW = 32 -# The default integer-part-length values to use for Symbols without EXPLORE_FIX pragma: Comma-separated Positive integer value +# The default integer-part-length values to use for Symbols without EXPLORE_FIX pragma: Comma-separated, Positive integer value or value range (min..max) # Default value: 16 defaultFixedI = 16 -# The default wordlength values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated Positive integer value +# The default wordlength values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated, Positive integer value or value range (min..max) # Default value: 32 defaultFloatW = 32 -# The default exponent length values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated Positive integer value +# The default exponent length values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated, Positive integer value or value range (min..max) # Default value: 8 defaultFloatE = 8 + +# Set to 1 if the values are signed by default, 0 otherwise. +# Default value: 1 +defaultSigned = 1 + diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/model/TypeExploration.xcore b/bundles/fr.irisa.cairn.gecos.typeexploration/model/TypeExploration.xcore index ca49259e54f58bb5e08c1500dbdb1becd4970685..21772461d30273ec3a9333efb4217bcea023a8c0 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/model/TypeExploration.xcore +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/model/TypeExploration.xcore @@ -26,6 +26,7 @@ import fr.irisa.cairn.gecos.typeexploration.solutionspace.SolutionSpaceAnalyzer abstract class TypeParam { op int getTotalWidth() + op boolean equals(TypeParam other) } class FixedPointTypeParam extends TypeParam { @@ -35,8 +36,20 @@ class FixedPointTypeParam extends TypeParam { QuantificationMode quantificationMode OverflowMode overflowMode + op boolean equals(TypeParam other) { + if (other instanceof FixedPointTypeParam) { + signed == other.signed && + totalWidth == other.totalWidth && + integerWidth == other.integerWidth && + quantificationMode == other.quantificationMode && + overflowMode == other.overflowMode + } else { + false + } + } + op String toString() { - "Fixed-point type: " + (if(signed)"signed" else "") + " W="+getTotalWidth + " I="+getIntegerWidth + " Q="+quantificationMode + " O="+overflowMode; + "Fixed-point type: " + (if(!signed)"un" else "") + "signed W="+getTotalWidth + " I="+getIntegerWidth + " Q="+quantificationMode + " O="+overflowMode; } } @@ -46,8 +59,19 @@ class FloatPointTypeParam extends TypeParam { int exponentWidth int exponentBias + op boolean equals(TypeParam other) { + if (other instanceof FloatPointTypeParam) { + signed == other.signed && + totalWidth == other.totalWidth && + exponentWidth == other.exponentWidth && + exponentBias == other.exponentBias + } else { + false + } + } + op String toString() { - "Floating-point type:" + (if(signed)"signed" else "") + " W="+getTotalWidth + " E="+getExponentWidth; + "Floating-point type:" + (if(!signed)"un" else "") + "signed W="+getTotalWidth + " E="+getExponentWidth; } } @@ -90,12 +114,26 @@ class SameTypeConstraint extends TypeConstraint { //---- SOLUTION SPACE -abstract class TypeConfiguration { +interface TypeConfiguration { } -class FixedPointTypeConfiguration extends TypeConfiguration { - //TODO sign ? + +abstract class NumberTypeConfiguration extends TypeConfiguration{ + //TODO sign ? + unique boolean[] signed unique int[] totalWidthValues + + op NumberTypeConfiguration mergeIn(NumberTypeConfiguration c) { + signed.addAll(c.signed) + totalWidthValues.addAll(c.totalWidthValues) + return this + } + op NumberTypeConfiguration copy() { + EcoreUtil.copy(this) + } +} + +class FixedPointTypeConfiguration extends NumberTypeConfiguration { unique int[] integerWidthValues unique QuantificationMode[] quantificationMode unique OverflowMode[] overflowMode @@ -105,25 +143,19 @@ class FixedPointTypeConfiguration extends TypeConfiguration { * @return this */ op FixedPointTypeConfiguration mergeIn(FixedPointTypeConfiguration c) { - totalWidthValues.addAll(c.totalWidthValues) + super.mergeIn(c); integerWidthValues.addAll(c.integerWidthValues) quantificationMode.addAll(c.quantificationMode) overflowMode.addAll(c.overflowMode) return this } - op FixedPointTypeConfiguration copy() { - EcoreUtil.copy(this) - } - op String toString() { - "Fixed-point: W=" + totalWidthValues + " I=" + integerWidthValues; + "Fixed-point: S=" + signed +" W=" + totalWidthValues + " I=" + integerWidthValues; } } -class FloatPointTypeConfiguration extends TypeConfiguration { - //TODO sign ? - unique int[] totalWidthValues +class FloatPointTypeConfiguration extends NumberTypeConfiguration { unique int[] exponentWidthValues unique int[] biasValues @@ -132,24 +164,19 @@ class FloatPointTypeConfiguration extends TypeConfiguration { * @return this */ op FloatPointTypeConfiguration mergeIn(FloatPointTypeConfiguration c) { - totalWidthValues.addAll(c.totalWidthValues) + super.mergeIn(c); exponentWidthValues.addAll(c.exponentWidthValues) biasValues.addAll(c.biasValues) return this } - - op FloatPointTypeConfiguration copy() { - EcoreUtil.copy(this) - } op String toString() { - "Floating-point: W="+totalWidthValues + " E="+exponentWidthValues; + "Floating-point: S=" + signed +" W="+totalWidthValues + " E="+exponentWidthValues; } } class TypeConfigurationSpace { -// contains TypeConfiguration[] configs contains FixedPointTypeConfiguration fixedPtCongurations contains FloatPointTypeConfiguration floatPtCongurations contains TypeConstraint[] constraints @@ -281,6 +308,10 @@ class SolutionSpace { EcoreUtil.copy(this) } + op String getUniqueTypeName(Symbol s) { + return "TYPE_" + s.getName() + "_" + exploredSymbols.indexOfKey(s) + } + op String toString() { "Solution Space (" + exploredSymbols.size + "):\n" + getSymbols.join("\n", ["\tSymbol '" + SolutionSpaceUtils.printSymbol(it) + "' (" + it.class.simpleName + "):\n" + getTypeSpace(it)]) diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/plugin.xml b/bundles/fr.irisa.cairn.gecos.typeexploration/plugin.xml index da30bb2c9c3d28b46243eecea54221e20fa91976..64c68e5a163201c427a6b890fe5cb2cc5255a591 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/plugin.xml +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/plugin.xml @@ -18,12 +18,4 @@ genModel="model/TypeExploration.xcore"/> </extension> - <extension point="org.eclipse.emf.ecore.generated_package"> - <!-- @generated Computation --> - <package - uri="http://www.gecos.org/float2fix/computation" - class="typeexploration.computation.ComputationPackage" - genModel="Computation.xcore"/> - </extension> - </plugin> diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/pom.xml b/bundles/fr.irisa.cairn.gecos.typeexploration/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..6224590c1232a8bf1c4a69e183150aeb44779886 --- /dev/null +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/pom.xml @@ -0,0 +1,33 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <artifactId>fr.irisa.cairn.gecos.typeexploration</artifactId> + <packaging>eclipse-plugin</packaging> + <version>1.0.0-SNAPSHOT</version> + + <parent> + <groupId>fr.irisa.cairn.gecos.float2fix</groupId> + <artifactId>fr.irisa.cairn.gecos.float2fix.bundles</artifactId> + <version>1.0.0</version> + <relativePath>..</relativePath> + </parent> + + <build> + <plugins> + <plugin> + <groupId>org.eclipse.xtext</groupId> + <artifactId>xtext-maven-plugin</artifactId> + </plugin> + <!-- + Enable xtend maven plugin on XCore projects in order to + automatically apply XText nature on the eclipse project + via M2E plugins; + --> + <plugin> + <groupId>org.eclipse.xtend</groupId> + <artifactId>xtend-maven-plugin</artifactId> + </plugin> + </plugins> + </build> +</project> diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FixedPointTypeConfiguration.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FixedPointTypeConfiguration.java index 254220c24ee0da32b69956e78b9217d2c4d8a1a5..e2d8c0e19aacc2e3ec6f2fd513e8bd3d6b510618 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FixedPointTypeConfiguration.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FixedPointTypeConfiguration.java @@ -16,7 +16,6 @@ import org.eclipse.emf.common.util.EList; * The following features are supported: * </p> * <ul> - * <li>{@link typeexploration.FixedPointTypeConfiguration#getTotalWidthValues <em>Total Width Values</em>}</li> * <li>{@link typeexploration.FixedPointTypeConfiguration#getIntegerWidthValues <em>Integer Width Values</em>}</li> * <li>{@link typeexploration.FixedPointTypeConfiguration#getQuantificationMode <em>Quantification Mode</em>}</li> * <li>{@link typeexploration.FixedPointTypeConfiguration#getOverflowMode <em>Overflow Mode</em>}</li> @@ -26,23 +25,7 @@ import org.eclipse.emf.common.util.EList; * @model * @generated */ -public interface FixedPointTypeConfiguration extends TypeConfiguration { - /** - * Returns the value of the '<em><b>Total Width Values</b></em>' attribute list. - * The list contents are of type {@link java.lang.Integer}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Total Width Values</em>' attribute list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Total Width Values</em>' attribute list. - * @see typeexploration.TypeexplorationPackage#getFixedPointTypeConfiguration_TotalWidthValues() - * @model - * @generated - */ - EList<Integer> getTotalWidthValues(); - +public interface FixedPointTypeConfiguration extends NumberTypeConfiguration { /** * Returns the value of the '<em><b>Integer Width Values</b></em>' attribute list. * The list contents are of type {@link java.lang.Integer}. @@ -103,7 +86,7 @@ public interface FixedPointTypeConfiguration extends TypeConfiguration { * @return this * <!-- end-model-doc --> * @model unique="false" cUnique="false" - * annotation="http://www.eclipse.org/emf/2002/GenModel body='this.getTotalWidthValues().addAll(c.getTotalWidthValues());\nthis.getIntegerWidthValues().addAll(c.getIntegerWidthValues());\nthis.getQuantificationMode().addAll(c.getQuantificationMode());\nthis.getOverflowMode().addAll(c.getOverflowMode());\nreturn this;'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='super.mergeIn(c);\nthis.getIntegerWidthValues().addAll(c.getIntegerWidthValues());\nthis.getQuantificationMode().addAll(c.getQuantificationMode());\nthis.getOverflowMode().addAll(c.getOverflowMode());\nreturn this;'" * @generated */ FixedPointTypeConfiguration mergeIn(FixedPointTypeConfiguration c); @@ -112,16 +95,7 @@ public interface FixedPointTypeConfiguration extends TypeConfiguration { * <!-- begin-user-doc --> * <!-- end-user-doc --> * @model unique="false" - * annotation="http://www.eclipse.org/emf/2002/GenModel body='return <%org.eclipse.emf.ecore.util.EcoreUtil%>.<<%typeexploration.FixedPointTypeConfiguration%>>copy(this);'" - * @generated - */ - FixedPointTypeConfiguration copy(); - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @model unique="false" - * annotation="http://www.eclipse.org/emf/2002/GenModel body='<%org.eclipse.emf.common.util.EList%><<%java.lang.Integer%>> _totalWidthValues = this.getTotalWidthValues();\n<%java.lang.String%> _plus = (\"Fixed-point: W=\" + _totalWidthValues);\n<%java.lang.String%> _plus_1 = (_plus + \" I=\");\n<%org.eclipse.emf.common.util.EList%><<%java.lang.Integer%>> _integerWidthValues = this.getIntegerWidthValues();\nreturn (_plus_1 + _integerWidthValues);'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='<%org.eclipse.emf.common.util.EList%><<%java.lang.Boolean%>> _signed = this.getSigned();\n<%java.lang.String%> _plus = (\"Fixed-point: S=\" + _signed);\n<%java.lang.String%> _plus_1 = (_plus + \" W=\");\n<%org.eclipse.emf.common.util.EList%><<%java.lang.Integer%>> _totalWidthValues = this.getTotalWidthValues();\n<%java.lang.String%> _plus_2 = (_plus_1 + _totalWidthValues);\n<%java.lang.String%> _plus_3 = (_plus_2 + \" I=\");\n<%org.eclipse.emf.common.util.EList%><<%java.lang.Integer%>> _integerWidthValues = this.getIntegerWidthValues();\nreturn (_plus_3 + _integerWidthValues);'" * @generated */ String toString(); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FixedPointTypeParam.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FixedPointTypeParam.java index 7ce85c5e231c7b1b8c5f62640aba4391e58830aa..f9f77dd506c3f92fc8d3ac21c6000e7e8056745c 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FixedPointTypeParam.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FixedPointTypeParam.java @@ -163,11 +163,20 @@ public interface FixedPointTypeParam extends TypeParam { */ void setOverflowMode(OverflowMode value); + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model unique="false" otherUnique="false" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='boolean _xifexpression = false;\nif ((other instanceof <%typeexploration.FixedPointTypeParam%>))\n{\n\t_xifexpression = (((((this.isSigned() == ((<%typeexploration.FixedPointTypeParam%>)other).isSigned()) && \n\t\t(this.getTotalWidth() == ((<%typeexploration.FixedPointTypeParam%>)other).getTotalWidth())) && \n\t\t(this.getIntegerWidth() == ((<%typeexploration.FixedPointTypeParam%>)other).getIntegerWidth())) && \n\t\t<%com.google.common.base.Objects%>.equal(this.getQuantificationMode(), ((<%typeexploration.FixedPointTypeParam%>)other).getQuantificationMode())) && \n\t\t<%com.google.common.base.Objects%>.equal(this.getOverflowMode(), ((<%typeexploration.FixedPointTypeParam%>)other).getOverflowMode()));\n}\nelse\n{\n\t_xifexpression = false;\n}\nreturn _xifexpression;'" + * @generated + */ + boolean equals(TypeParam other); + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @model unique="false" - * annotation="http://www.eclipse.org/emf/2002/GenModel body='<%java.lang.String%> _xifexpression = null;\nboolean _isSigned = this.isSigned();\nif (_isSigned)\n{\n\t_xifexpression = \"signed\";\n}\nelse\n{\n\t_xifexpression = \"\";\n}\n<%java.lang.String%> _plus = (\"Fixed-point type: \" + _xifexpression);\n<%java.lang.String%> _plus_1 = (_plus + \" W=\");\nint _totalWidth = this.getTotalWidth();\n<%java.lang.String%> _plus_2 = (_plus_1 + <%java.lang.Integer%>.valueOf(_totalWidth));\n<%java.lang.String%> _plus_3 = (_plus_2 + \" I=\");\nint _integerWidth = this.getIntegerWidth();\n<%java.lang.String%> _plus_4 = (_plus_3 + <%java.lang.Integer%>.valueOf(_integerWidth));\n<%java.lang.String%> _plus_5 = (_plus_4 + \" Q=\");\n<%gecos.types.QuantificationMode%> _quantificationMode = this.getQuantificationMode();\n<%java.lang.String%> _plus_6 = (_plus_5 + _quantificationMode);\n<%java.lang.String%> _plus_7 = (_plus_6 + \" O=\");\n<%gecos.types.OverflowMode%> _overflowMode = this.getOverflowMode();\nreturn (_plus_7 + _overflowMode);'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='<%java.lang.String%> _xifexpression = null;\nboolean _isSigned = this.isSigned();\nboolean _not = (!_isSigned);\nif (_not)\n{\n\t_xifexpression = \"un\";\n}\nelse\n{\n\t_xifexpression = \"\";\n}\n<%java.lang.String%> _plus = (\"Fixed-point type: \" + _xifexpression);\n<%java.lang.String%> _plus_1 = (_plus + \"signed W=\");\nint _totalWidth = this.getTotalWidth();\n<%java.lang.String%> _plus_2 = (_plus_1 + <%java.lang.Integer%>.valueOf(_totalWidth));\n<%java.lang.String%> _plus_3 = (_plus_2 + \" I=\");\nint _integerWidth = this.getIntegerWidth();\n<%java.lang.String%> _plus_4 = (_plus_3 + <%java.lang.Integer%>.valueOf(_integerWidth));\n<%java.lang.String%> _plus_5 = (_plus_4 + \" Q=\");\n<%gecos.types.QuantificationMode%> _quantificationMode = this.getQuantificationMode();\n<%java.lang.String%> _plus_6 = (_plus_5 + _quantificationMode);\n<%java.lang.String%> _plus_7 = (_plus_6 + \" O=\");\n<%gecos.types.OverflowMode%> _overflowMode = this.getOverflowMode();\nreturn (_plus_7 + _overflowMode);'" * @generated */ String toString(); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FloatPointTypeConfiguration.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FloatPointTypeConfiguration.java index 4537aae71e91632177870e6d3a985f75fe82f261..6dcf0d266ab3cfc8bc08a7b3e8740c61bc6b3aea 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FloatPointTypeConfiguration.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FloatPointTypeConfiguration.java @@ -13,7 +13,6 @@ import org.eclipse.emf.common.util.EList; * The following features are supported: * </p> * <ul> - * <li>{@link typeexploration.FloatPointTypeConfiguration#getTotalWidthValues <em>Total Width Values</em>}</li> * <li>{@link typeexploration.FloatPointTypeConfiguration#getExponentWidthValues <em>Exponent Width Values</em>}</li> * <li>{@link typeexploration.FloatPointTypeConfiguration#getBiasValues <em>Bias Values</em>}</li> * </ul> @@ -22,23 +21,7 @@ import org.eclipse.emf.common.util.EList; * @model * @generated */ -public interface FloatPointTypeConfiguration extends TypeConfiguration { - /** - * Returns the value of the '<em><b>Total Width Values</b></em>' attribute list. - * The list contents are of type {@link java.lang.Integer}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Total Width Values</em>' attribute list isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Total Width Values</em>' attribute list. - * @see typeexploration.TypeexplorationPackage#getFloatPointTypeConfiguration_TotalWidthValues() - * @model - * @generated - */ - EList<Integer> getTotalWidthValues(); - +public interface FloatPointTypeConfiguration extends NumberTypeConfiguration { /** * Returns the value of the '<em><b>Exponent Width Values</b></em>' attribute list. * The list contents are of type {@link java.lang.Integer}. @@ -79,7 +62,7 @@ public interface FloatPointTypeConfiguration extends TypeConfiguration { * @return this * <!-- end-model-doc --> * @model unique="false" cUnique="false" - * annotation="http://www.eclipse.org/emf/2002/GenModel body='this.getTotalWidthValues().addAll(c.getTotalWidthValues());\nthis.getExponentWidthValues().addAll(c.getExponentWidthValues());\nthis.getBiasValues().addAll(c.getBiasValues());\nreturn this;'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='super.mergeIn(c);\nthis.getExponentWidthValues().addAll(c.getExponentWidthValues());\nthis.getBiasValues().addAll(c.getBiasValues());\nreturn this;'" * @generated */ FloatPointTypeConfiguration mergeIn(FloatPointTypeConfiguration c); @@ -88,16 +71,7 @@ public interface FloatPointTypeConfiguration extends TypeConfiguration { * <!-- begin-user-doc --> * <!-- end-user-doc --> * @model unique="false" - * annotation="http://www.eclipse.org/emf/2002/GenModel body='return <%org.eclipse.emf.ecore.util.EcoreUtil%>.<<%typeexploration.FloatPointTypeConfiguration%>>copy(this);'" - * @generated - */ - FloatPointTypeConfiguration copy(); - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @model unique="false" - * annotation="http://www.eclipse.org/emf/2002/GenModel body='<%org.eclipse.emf.common.util.EList%><<%java.lang.Integer%>> _totalWidthValues = this.getTotalWidthValues();\n<%java.lang.String%> _plus = (\"Floating-point: W=\" + _totalWidthValues);\n<%java.lang.String%> _plus_1 = (_plus + \" E=\");\n<%org.eclipse.emf.common.util.EList%><<%java.lang.Integer%>> _exponentWidthValues = this.getExponentWidthValues();\nreturn (_plus_1 + _exponentWidthValues);'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='<%org.eclipse.emf.common.util.EList%><<%java.lang.Boolean%>> _signed = this.getSigned();\n<%java.lang.String%> _plus = (\"Floating-point: S=\" + _signed);\n<%java.lang.String%> _plus_1 = (_plus + \" W=\");\n<%org.eclipse.emf.common.util.EList%><<%java.lang.Integer%>> _totalWidthValues = this.getTotalWidthValues();\n<%java.lang.String%> _plus_2 = (_plus_1 + _totalWidthValues);\n<%java.lang.String%> _plus_3 = (_plus_2 + \" E=\");\n<%org.eclipse.emf.common.util.EList%><<%java.lang.Integer%>> _exponentWidthValues = this.getExponentWidthValues();\nreturn (_plus_3 + _exponentWidthValues);'" * @generated */ String toString(); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FloatPointTypeParam.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FloatPointTypeParam.java index c1d031d969c800b46d8d21883722edcec206558b..77eb6feda27376c82eba9e459da904cd251f1790 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FloatPointTypeParam.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/FloatPointTypeParam.java @@ -128,11 +128,20 @@ public interface FloatPointTypeParam extends TypeParam { */ void setExponentBias(int value); + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model unique="false" otherUnique="false" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='boolean _xifexpression = false;\nif ((other instanceof <%typeexploration.FloatPointTypeParam%>))\n{\n\t_xifexpression = ((((this.isSigned() == ((<%typeexploration.FloatPointTypeParam%>)other).isSigned()) && \n\t\t(this.getTotalWidth() == ((<%typeexploration.FloatPointTypeParam%>)other).getTotalWidth())) && \n\t\t(this.getExponentWidth() == ((<%typeexploration.FloatPointTypeParam%>)other).getExponentWidth())) && \n\t\t(this.getExponentBias() == ((<%typeexploration.FloatPointTypeParam%>)other).getExponentBias()));\n}\nelse\n{\n\t_xifexpression = false;\n}\nreturn _xifexpression;'" + * @generated + */ + boolean equals(TypeParam other); + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @model unique="false" - * annotation="http://www.eclipse.org/emf/2002/GenModel body='<%java.lang.String%> _xifexpression = null;\nboolean _isSigned = this.isSigned();\nif (_isSigned)\n{\n\t_xifexpression = \"signed\";\n}\nelse\n{\n\t_xifexpression = \"\";\n}\n<%java.lang.String%> _plus = (\"Floating-point type:\" + _xifexpression);\n<%java.lang.String%> _plus_1 = (_plus + \" W=\");\nint _totalWidth = this.getTotalWidth();\n<%java.lang.String%> _plus_2 = (_plus_1 + <%java.lang.Integer%>.valueOf(_totalWidth));\n<%java.lang.String%> _plus_3 = (_plus_2 + \" E=\");\nint _exponentWidth = this.getExponentWidth();\nreturn (_plus_3 + <%java.lang.Integer%>.valueOf(_exponentWidth));'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='<%java.lang.String%> _xifexpression = null;\nboolean _isSigned = this.isSigned();\nboolean _not = (!_isSigned);\nif (_not)\n{\n\t_xifexpression = \"un\";\n}\nelse\n{\n\t_xifexpression = \"\";\n}\n<%java.lang.String%> _plus = (\"Floating-point type:\" + _xifexpression);\n<%java.lang.String%> _plus_1 = (_plus + \"signed W=\");\nint _totalWidth = this.getTotalWidth();\n<%java.lang.String%> _plus_2 = (_plus_1 + <%java.lang.Integer%>.valueOf(_totalWidth));\n<%java.lang.String%> _plus_3 = (_plus_2 + \" E=\");\nint _exponentWidth = this.getExponentWidth();\nreturn (_plus_3 + <%java.lang.Integer%>.valueOf(_exponentWidth));'" * @generated */ String toString(); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/NumberTypeConfiguration.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/NumberTypeConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..a5061c6049686c1a9d0e9ec8691370f3e4c96425 --- /dev/null +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/NumberTypeConfiguration.java @@ -0,0 +1,75 @@ +/** + */ +package typeexploration; + +import org.eclipse.emf.common.util.EList; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Number Type Configuration</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link typeexploration.NumberTypeConfiguration#getSigned <em>Signed</em>}</li> + * <li>{@link typeexploration.NumberTypeConfiguration#getTotalWidthValues <em>Total Width Values</em>}</li> + * </ul> + * + * @see typeexploration.TypeexplorationPackage#getNumberTypeConfiguration() + * @model abstract="true" + * @generated + */ +public interface NumberTypeConfiguration extends TypeConfiguration { + /** + * Returns the value of the '<em><b>Signed</b></em>' attribute list. + * The list contents are of type {@link java.lang.Boolean}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Signed</em>' attribute list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Signed</em>' attribute list. + * @see typeexploration.TypeexplorationPackage#getNumberTypeConfiguration_Signed() + * @model + * @generated + */ + EList<Boolean> getSigned(); + + /** + * Returns the value of the '<em><b>Total Width Values</b></em>' attribute list. + * The list contents are of type {@link java.lang.Integer}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Total Width Values</em>' attribute list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Total Width Values</em>' attribute list. + * @see typeexploration.TypeexplorationPackage#getNumberTypeConfiguration_TotalWidthValues() + * @model + * @generated + */ + EList<Integer> getTotalWidthValues(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model unique="false" cUnique="false" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='this.getSigned().addAll(c.getSigned());\nthis.getTotalWidthValues().addAll(c.getTotalWidthValues());\nreturn this;'" + * @generated + */ + NumberTypeConfiguration mergeIn(NumberTypeConfiguration c); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model unique="false" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='return <%org.eclipse.emf.ecore.util.EcoreUtil%>.<<%typeexploration.NumberTypeConfiguration%>>copy(this);'" + * @generated + */ + NumberTypeConfiguration copy(); + +} // NumberTypeConfiguration diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/SolutionSpace.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/SolutionSpace.java index 65b1dee3768458367d65af7b0c18eac93c9a61ae..1596bd0decbe82a5b8a66886493b0257667c20ae 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/SolutionSpace.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/SolutionSpace.java @@ -262,6 +262,15 @@ public interface SolutionSpace extends EObject { */ SolutionSpace copy(); + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model unique="false" sUnique="false" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='<%java.lang.String%> _name = s.getName();\n<%java.lang.String%> _plus = (\"TYPE_\" + _name);\n<%java.lang.String%> _plus_1 = (_plus + \"_\");\nint _indexOfKey = this.getExploredSymbols().indexOfKey(s);\nreturn (_plus_1 + <%java.lang.Integer%>.valueOf(_indexOfKey));'" + * @generated + */ + String getUniqueTypeName(Symbol s); + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/TypeConfiguration.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/TypeConfiguration.java index e3000121cfbcb14dcc8ae1067aa144c115a00923..5af999ae9d4f85097e9e87ee296ddb77a8a31d37 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/TypeConfiguration.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/TypeConfiguration.java @@ -11,7 +11,7 @@ import org.eclipse.emf.ecore.EObject; * * * @see typeexploration.TypeexplorationPackage#getTypeConfiguration() - * @model abstract="true" + * @model interface="true" abstract="true" * @generated */ public interface TypeConfiguration extends EObject { diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/TypeParam.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/TypeParam.java index e6975a09658b1479a084987167a77bd90bbf9b0a..63a5b138dff1c82575afa849de2661cea0f52046 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/TypeParam.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/TypeParam.java @@ -23,4 +23,12 @@ public interface TypeParam extends EObject { */ int getTotalWidth(); + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model unique="false" otherUnique="false" + * @generated + */ + boolean equals(TypeParam other); + } // TypeParam diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/TypeexplorationPackage.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/TypeexplorationPackage.java index 137141ab527c06ea09520d749794b08db8823036..eb3a884523152d0daa42d571a854ecd03359ef49 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/TypeexplorationPackage.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/TypeexplorationPackage.java @@ -271,10 +271,10 @@ public interface TypeexplorationPackage extends EPackage { int SAME_TYPE_CONSTRAINT_FEATURE_COUNT = TYPE_CONSTRAINT_FEATURE_COUNT + 1; /** - * The meta object id for the '{@link typeexploration.impl.TypeConfigurationImpl <em>Type Configuration</em>}' class. + * The meta object id for the '{@link typeexploration.TypeConfiguration <em>Type Configuration</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see typeexploration.impl.TypeConfigurationImpl + * @see typeexploration.TypeConfiguration * @see typeexploration.impl.TypeexplorationPackageImpl#getTypeConfiguration() * @generated */ @@ -289,6 +289,43 @@ public interface TypeexplorationPackage extends EPackage { */ int TYPE_CONFIGURATION_FEATURE_COUNT = 0; + /** + * The meta object id for the '{@link typeexploration.impl.NumberTypeConfigurationImpl <em>Number Type Configuration</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see typeexploration.impl.NumberTypeConfigurationImpl + * @see typeexploration.impl.TypeexplorationPackageImpl#getNumberTypeConfiguration() + * @generated + */ + int NUMBER_TYPE_CONFIGURATION = 7; + + /** + * The feature id for the '<em><b>Signed</b></em>' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int NUMBER_TYPE_CONFIGURATION__SIGNED = TYPE_CONFIGURATION_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Total Width Values</b></em>' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int NUMBER_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES = TYPE_CONFIGURATION_FEATURE_COUNT + 1; + + /** + * The number of structural features of the '<em>Number Type Configuration</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int NUMBER_TYPE_CONFIGURATION_FEATURE_COUNT = TYPE_CONFIGURATION_FEATURE_COUNT + 2; + /** * The meta object id for the '{@link typeexploration.impl.FixedPointTypeConfigurationImpl <em>Fixed Point Type Configuration</em>}' class. * <!-- begin-user-doc --> @@ -297,7 +334,16 @@ public interface TypeexplorationPackage extends EPackage { * @see typeexploration.impl.TypeexplorationPackageImpl#getFixedPointTypeConfiguration() * @generated */ - int FIXED_POINT_TYPE_CONFIGURATION = 7; + int FIXED_POINT_TYPE_CONFIGURATION = 8; + + /** + * The feature id for the '<em><b>Signed</b></em>' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FIXED_POINT_TYPE_CONFIGURATION__SIGNED = NUMBER_TYPE_CONFIGURATION__SIGNED; /** * The feature id for the '<em><b>Total Width Values</b></em>' attribute list. @@ -306,7 +352,7 @@ public interface TypeexplorationPackage extends EPackage { * @generated * @ordered */ - int FIXED_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES = TYPE_CONFIGURATION_FEATURE_COUNT + 0; + int FIXED_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES = NUMBER_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES; /** * The feature id for the '<em><b>Integer Width Values</b></em>' attribute list. @@ -315,7 +361,7 @@ public interface TypeexplorationPackage extends EPackage { * @generated * @ordered */ - int FIXED_POINT_TYPE_CONFIGURATION__INTEGER_WIDTH_VALUES = TYPE_CONFIGURATION_FEATURE_COUNT + 1; + int FIXED_POINT_TYPE_CONFIGURATION__INTEGER_WIDTH_VALUES = NUMBER_TYPE_CONFIGURATION_FEATURE_COUNT + 0; /** * The feature id for the '<em><b>Quantification Mode</b></em>' attribute list. @@ -324,7 +370,7 @@ public interface TypeexplorationPackage extends EPackage { * @generated * @ordered */ - int FIXED_POINT_TYPE_CONFIGURATION__QUANTIFICATION_MODE = TYPE_CONFIGURATION_FEATURE_COUNT + 2; + int FIXED_POINT_TYPE_CONFIGURATION__QUANTIFICATION_MODE = NUMBER_TYPE_CONFIGURATION_FEATURE_COUNT + 1; /** * The feature id for the '<em><b>Overflow Mode</b></em>' attribute list. @@ -333,7 +379,7 @@ public interface TypeexplorationPackage extends EPackage { * @generated * @ordered */ - int FIXED_POINT_TYPE_CONFIGURATION__OVERFLOW_MODE = TYPE_CONFIGURATION_FEATURE_COUNT + 3; + int FIXED_POINT_TYPE_CONFIGURATION__OVERFLOW_MODE = NUMBER_TYPE_CONFIGURATION_FEATURE_COUNT + 2; /** * The number of structural features of the '<em>Fixed Point Type Configuration</em>' class. @@ -342,7 +388,7 @@ public interface TypeexplorationPackage extends EPackage { * @generated * @ordered */ - int FIXED_POINT_TYPE_CONFIGURATION_FEATURE_COUNT = TYPE_CONFIGURATION_FEATURE_COUNT + 4; + int FIXED_POINT_TYPE_CONFIGURATION_FEATURE_COUNT = NUMBER_TYPE_CONFIGURATION_FEATURE_COUNT + 3; /** * The meta object id for the '{@link typeexploration.impl.FloatPointTypeConfigurationImpl <em>Float Point Type Configuration</em>}' class. @@ -352,7 +398,16 @@ public interface TypeexplorationPackage extends EPackage { * @see typeexploration.impl.TypeexplorationPackageImpl#getFloatPointTypeConfiguration() * @generated */ - int FLOAT_POINT_TYPE_CONFIGURATION = 8; + int FLOAT_POINT_TYPE_CONFIGURATION = 9; + + /** + * The feature id for the '<em><b>Signed</b></em>' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int FLOAT_POINT_TYPE_CONFIGURATION__SIGNED = NUMBER_TYPE_CONFIGURATION__SIGNED; /** * The feature id for the '<em><b>Total Width Values</b></em>' attribute list. @@ -361,7 +416,7 @@ public interface TypeexplorationPackage extends EPackage { * @generated * @ordered */ - int FLOAT_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES = TYPE_CONFIGURATION_FEATURE_COUNT + 0; + int FLOAT_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES = NUMBER_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES; /** * The feature id for the '<em><b>Exponent Width Values</b></em>' attribute list. @@ -370,7 +425,7 @@ public interface TypeexplorationPackage extends EPackage { * @generated * @ordered */ - int FLOAT_POINT_TYPE_CONFIGURATION__EXPONENT_WIDTH_VALUES = TYPE_CONFIGURATION_FEATURE_COUNT + 1; + int FLOAT_POINT_TYPE_CONFIGURATION__EXPONENT_WIDTH_VALUES = NUMBER_TYPE_CONFIGURATION_FEATURE_COUNT + 0; /** * The feature id for the '<em><b>Bias Values</b></em>' attribute list. @@ -379,7 +434,7 @@ public interface TypeexplorationPackage extends EPackage { * @generated * @ordered */ - int FLOAT_POINT_TYPE_CONFIGURATION__BIAS_VALUES = TYPE_CONFIGURATION_FEATURE_COUNT + 2; + int FLOAT_POINT_TYPE_CONFIGURATION__BIAS_VALUES = NUMBER_TYPE_CONFIGURATION_FEATURE_COUNT + 1; /** * The number of structural features of the '<em>Float Point Type Configuration</em>' class. @@ -388,7 +443,7 @@ public interface TypeexplorationPackage extends EPackage { * @generated * @ordered */ - int FLOAT_POINT_TYPE_CONFIGURATION_FEATURE_COUNT = TYPE_CONFIGURATION_FEATURE_COUNT + 3; + int FLOAT_POINT_TYPE_CONFIGURATION_FEATURE_COUNT = NUMBER_TYPE_CONFIGURATION_FEATURE_COUNT + 2; /** * The meta object id for the '{@link typeexploration.impl.TypeConfigurationSpaceImpl <em>Type Configuration Space</em>}' class. @@ -398,7 +453,7 @@ public interface TypeexplorationPackage extends EPackage { * @see typeexploration.impl.TypeexplorationPackageImpl#getTypeConfigurationSpace() * @generated */ - int TYPE_CONFIGURATION_SPACE = 9; + int TYPE_CONFIGURATION_SPACE = 10; /** * The feature id for the '<em><b>Fixed Pt Congurations</b></em>' containment reference. @@ -444,7 +499,7 @@ public interface TypeexplorationPackage extends EPackage { * @see typeexploration.impl.TypeexplorationPackageImpl#getSymbolToTypeConfigurationsEntry() * @generated */ - int SYMBOL_TO_TYPE_CONFIGURATIONS_ENTRY = 10; + int SYMBOL_TO_TYPE_CONFIGURATIONS_ENTRY = 11; /** * The feature id for the '<em><b>Key</b></em>' reference. @@ -481,7 +536,7 @@ public interface TypeexplorationPackage extends EPackage { * @see typeexploration.impl.TypeexplorationPackageImpl#getSolutionSpace() * @generated */ - int SOLUTION_SPACE = 11; + int SOLUTION_SPACE = 12; /** * The feature id for the '<em><b>Project</b></em>' reference. @@ -536,7 +591,7 @@ public interface TypeexplorationPackage extends EPackage { * @see typeexploration.impl.TypeexplorationPackageImpl#getSolutionSpaceAnalyzer() * @generated */ - int SOLUTION_SPACE_ANALYZER = 12; + int SOLUTION_SPACE_ANALYZER = 13; /** @@ -731,25 +786,46 @@ public interface TypeexplorationPackage extends EPackage { EClass getTypeConfiguration(); /** - * Returns the meta object for class '{@link typeexploration.FixedPointTypeConfiguration <em>Fixed Point Type Configuration</em>}'. + * Returns the meta object for class '{@link typeexploration.NumberTypeConfiguration <em>Number Type Configuration</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @return the meta object for class '<em>Fixed Point Type Configuration</em>'. - * @see typeexploration.FixedPointTypeConfiguration + * @return the meta object for class '<em>Number Type Configuration</em>'. + * @see typeexploration.NumberTypeConfiguration * @generated */ - EClass getFixedPointTypeConfiguration(); + EClass getNumberTypeConfiguration(); /** - * Returns the meta object for the attribute list '{@link typeexploration.FixedPointTypeConfiguration#getTotalWidthValues <em>Total Width Values</em>}'. + * Returns the meta object for the attribute list '{@link typeexploration.NumberTypeConfiguration#getSigned <em>Signed</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute list '<em>Signed</em>'. + * @see typeexploration.NumberTypeConfiguration#getSigned() + * @see #getNumberTypeConfiguration() + * @generated + */ + EAttribute getNumberTypeConfiguration_Signed(); + + /** + * Returns the meta object for the attribute list '{@link typeexploration.NumberTypeConfiguration#getTotalWidthValues <em>Total Width Values</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute list '<em>Total Width Values</em>'. - * @see typeexploration.FixedPointTypeConfiguration#getTotalWidthValues() - * @see #getFixedPointTypeConfiguration() + * @see typeexploration.NumberTypeConfiguration#getTotalWidthValues() + * @see #getNumberTypeConfiguration() * @generated */ - EAttribute getFixedPointTypeConfiguration_TotalWidthValues(); + EAttribute getNumberTypeConfiguration_TotalWidthValues(); + + /** + * Returns the meta object for class '{@link typeexploration.FixedPointTypeConfiguration <em>Fixed Point Type Configuration</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Fixed Point Type Configuration</em>'. + * @see typeexploration.FixedPointTypeConfiguration + * @generated + */ + EClass getFixedPointTypeConfiguration(); /** * Returns the meta object for the attribute list '{@link typeexploration.FixedPointTypeConfiguration#getIntegerWidthValues <em>Integer Width Values</em>}'. @@ -794,17 +870,6 @@ public interface TypeexplorationPackage extends EPackage { */ EClass getFloatPointTypeConfiguration(); - /** - * Returns the meta object for the attribute list '{@link typeexploration.FloatPointTypeConfiguration#getTotalWidthValues <em>Total Width Values</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute list '<em>Total Width Values</em>'. - * @see typeexploration.FloatPointTypeConfiguration#getTotalWidthValues() - * @see #getFloatPointTypeConfiguration() - * @generated - */ - EAttribute getFloatPointTypeConfiguration_TotalWidthValues(); - /** * Returns the meta object for the attribute list '{@link typeexploration.FloatPointTypeConfiguration#getExponentWidthValues <em>Exponent Width Values</em>}'. * <!-- begin-user-doc --> @@ -1140,24 +1205,32 @@ public interface TypeexplorationPackage extends EPackage { EReference SAME_TYPE_CONSTRAINT__SYMBOL = eINSTANCE.getSameTypeConstraint_Symbol(); /** - * The meta object literal for the '{@link typeexploration.impl.TypeConfigurationImpl <em>Type Configuration</em>}' class. + * The meta object literal for the '{@link typeexploration.TypeConfiguration <em>Type Configuration</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see typeexploration.impl.TypeConfigurationImpl + * @see typeexploration.TypeConfiguration * @see typeexploration.impl.TypeexplorationPackageImpl#getTypeConfiguration() * @generated */ EClass TYPE_CONFIGURATION = eINSTANCE.getTypeConfiguration(); /** - * The meta object literal for the '{@link typeexploration.impl.FixedPointTypeConfigurationImpl <em>Fixed Point Type Configuration</em>}' class. + * The meta object literal for the '{@link typeexploration.impl.NumberTypeConfigurationImpl <em>Number Type Configuration</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see typeexploration.impl.FixedPointTypeConfigurationImpl - * @see typeexploration.impl.TypeexplorationPackageImpl#getFixedPointTypeConfiguration() + * @see typeexploration.impl.NumberTypeConfigurationImpl + * @see typeexploration.impl.TypeexplorationPackageImpl#getNumberTypeConfiguration() * @generated */ - EClass FIXED_POINT_TYPE_CONFIGURATION = eINSTANCE.getFixedPointTypeConfiguration(); + EClass NUMBER_TYPE_CONFIGURATION = eINSTANCE.getNumberTypeConfiguration(); + + /** + * The meta object literal for the '<em><b>Signed</b></em>' attribute list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute NUMBER_TYPE_CONFIGURATION__SIGNED = eINSTANCE.getNumberTypeConfiguration_Signed(); /** * The meta object literal for the '<em><b>Total Width Values</b></em>' attribute list feature. @@ -1165,7 +1238,17 @@ public interface TypeexplorationPackage extends EPackage { * <!-- end-user-doc --> * @generated */ - EAttribute FIXED_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES = eINSTANCE.getFixedPointTypeConfiguration_TotalWidthValues(); + EAttribute NUMBER_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES = eINSTANCE.getNumberTypeConfiguration_TotalWidthValues(); + + /** + * The meta object literal for the '{@link typeexploration.impl.FixedPointTypeConfigurationImpl <em>Fixed Point Type Configuration</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see typeexploration.impl.FixedPointTypeConfigurationImpl + * @see typeexploration.impl.TypeexplorationPackageImpl#getFixedPointTypeConfiguration() + * @generated + */ + EClass FIXED_POINT_TYPE_CONFIGURATION = eINSTANCE.getFixedPointTypeConfiguration(); /** * The meta object literal for the '<em><b>Integer Width Values</b></em>' attribute list feature. @@ -1201,14 +1284,6 @@ public interface TypeexplorationPackage extends EPackage { */ EClass FLOAT_POINT_TYPE_CONFIGURATION = eINSTANCE.getFloatPointTypeConfiguration(); - /** - * The meta object literal for the '<em><b>Total Width Values</b></em>' attribute list feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - EAttribute FLOAT_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES = eINSTANCE.getFloatPointTypeConfiguration_TotalWidthValues(); - /** * The meta object literal for the '<em><b>Exponent Width Values</b></em>' attribute list feature. * <!-- begin-user-doc --> diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FixedPointTypeConfigurationImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FixedPointTypeConfigurationImpl.java index 0294f7f412d562345f41d360a7bdb073633e4788..d33992210430122e837813a49fb79ae7cf811f99 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FixedPointTypeConfigurationImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FixedPointTypeConfigurationImpl.java @@ -12,7 +12,6 @@ import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; -import org.eclipse.emf.ecore.util.EcoreUtil; import typeexploration.FixedPointTypeConfiguration; import typeexploration.TypeexplorationPackage; @@ -25,7 +24,6 @@ import typeexploration.TypeexplorationPackage; * The following features are implemented: * </p> * <ul> - * <li>{@link typeexploration.impl.FixedPointTypeConfigurationImpl#getTotalWidthValues <em>Total Width Values</em>}</li> * <li>{@link typeexploration.impl.FixedPointTypeConfigurationImpl#getIntegerWidthValues <em>Integer Width Values</em>}</li> * <li>{@link typeexploration.impl.FixedPointTypeConfigurationImpl#getQuantificationMode <em>Quantification Mode</em>}</li> * <li>{@link typeexploration.impl.FixedPointTypeConfigurationImpl#getOverflowMode <em>Overflow Mode</em>}</li> @@ -33,17 +31,7 @@ import typeexploration.TypeexplorationPackage; * * @generated */ -public class FixedPointTypeConfigurationImpl extends TypeConfigurationImpl implements FixedPointTypeConfiguration { - /** - * The cached value of the '{@link #getTotalWidthValues() <em>Total Width Values</em>}' attribute list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getTotalWidthValues() - * @generated - * @ordered - */ - protected EList<Integer> totalWidthValues; - +public class FixedPointTypeConfigurationImpl extends NumberTypeConfigurationImpl implements FixedPointTypeConfiguration { /** * The cached value of the '{@link #getIntegerWidthValues() <em>Integer Width Values</em>}' attribute list. * <!-- begin-user-doc --> @@ -93,18 +81,6 @@ public class FixedPointTypeConfigurationImpl extends TypeConfigurationImpl imple return TypeexplorationPackage.Literals.FIXED_POINT_TYPE_CONFIGURATION; } - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList<Integer> getTotalWidthValues() { - if (totalWidthValues == null) { - totalWidthValues = new EDataTypeUniqueEList<Integer>(Integer.class, this, TypeexplorationPackage.FIXED_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES); - } - return totalWidthValues; - } - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -147,33 +123,27 @@ public class FixedPointTypeConfigurationImpl extends TypeConfigurationImpl imple * @generated */ public FixedPointTypeConfiguration mergeIn(final FixedPointTypeConfiguration c) { - this.getTotalWidthValues().addAll(c.getTotalWidthValues()); + super.mergeIn(c); this.getIntegerWidthValues().addAll(c.getIntegerWidthValues()); this.getQuantificationMode().addAll(c.getQuantificationMode()); this.getOverflowMode().addAll(c.getOverflowMode()); return this; } - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public FixedPointTypeConfiguration copy() { - return EcoreUtil.<FixedPointTypeConfiguration>copy(this); - } - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String toString() { + EList<Boolean> _signed = this.getSigned(); + String _plus = ("Fixed-point: S=" + _signed); + String _plus_1 = (_plus + " W="); EList<Integer> _totalWidthValues = this.getTotalWidthValues(); - String _plus = ("Fixed-point: W=" + _totalWidthValues); - String _plus_1 = (_plus + " I="); + String _plus_2 = (_plus_1 + _totalWidthValues); + String _plus_3 = (_plus_2 + " I="); EList<Integer> _integerWidthValues = this.getIntegerWidthValues(); - return (_plus_1 + _integerWidthValues); + return (_plus_3 + _integerWidthValues); } /** @@ -184,8 +154,6 @@ public class FixedPointTypeConfigurationImpl extends TypeConfigurationImpl imple @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case TypeexplorationPackage.FIXED_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES: - return getTotalWidthValues(); case TypeexplorationPackage.FIXED_POINT_TYPE_CONFIGURATION__INTEGER_WIDTH_VALUES: return getIntegerWidthValues(); case TypeexplorationPackage.FIXED_POINT_TYPE_CONFIGURATION__QUANTIFICATION_MODE: @@ -205,10 +173,6 @@ public class FixedPointTypeConfigurationImpl extends TypeConfigurationImpl imple @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case TypeexplorationPackage.FIXED_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES: - getTotalWidthValues().clear(); - getTotalWidthValues().addAll((Collection<? extends Integer>)newValue); - return; case TypeexplorationPackage.FIXED_POINT_TYPE_CONFIGURATION__INTEGER_WIDTH_VALUES: getIntegerWidthValues().clear(); getIntegerWidthValues().addAll((Collection<? extends Integer>)newValue); @@ -233,9 +197,6 @@ public class FixedPointTypeConfigurationImpl extends TypeConfigurationImpl imple @Override public void eUnset(int featureID) { switch (featureID) { - case TypeexplorationPackage.FIXED_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES: - getTotalWidthValues().clear(); - return; case TypeexplorationPackage.FIXED_POINT_TYPE_CONFIGURATION__INTEGER_WIDTH_VALUES: getIntegerWidthValues().clear(); return; @@ -257,8 +218,6 @@ public class FixedPointTypeConfigurationImpl extends TypeConfigurationImpl imple @Override public boolean eIsSet(int featureID) { switch (featureID) { - case TypeexplorationPackage.FIXED_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES: - return totalWidthValues != null && !totalWidthValues.isEmpty(); case TypeexplorationPackage.FIXED_POINT_TYPE_CONFIGURATION__INTEGER_WIDTH_VALUES: return integerWidthValues != null && !integerWidthValues.isEmpty(); case TypeexplorationPackage.FIXED_POINT_TYPE_CONFIGURATION__QUANTIFICATION_MODE: diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FixedPointTypeParamImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FixedPointTypeParamImpl.java index 1690d7b953b6ef951578bdfefd91d5f80101b24c..32f6bb3349cb0210fa531325350518dabdbe75a5 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FixedPointTypeParamImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FixedPointTypeParamImpl.java @@ -2,6 +2,8 @@ */ package typeexploration.impl; +import com.google.common.base.Objects; + import gecos.types.OverflowMode; import gecos.types.QuantificationMode; @@ -12,6 +14,7 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import typeexploration.FixedPointTypeParam; +import typeexploration.TypeParam; import typeexploration.TypeexplorationPackage; /** @@ -256,6 +259,26 @@ public class FixedPointTypeParamImpl extends TypeParamImpl implements FixedPoint eNotify(new ENotificationImpl(this, Notification.SET, TypeexplorationPackage.FIXED_POINT_TYPE_PARAM__OVERFLOW_MODE, oldOverflowMode, overflowMode)); } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean equals(final TypeParam other) { + boolean _xifexpression = false; + if ((other instanceof FixedPointTypeParam)) { + _xifexpression = (((((this.isSigned() == ((FixedPointTypeParam)other).isSigned()) && + (this.getTotalWidth() == ((FixedPointTypeParam)other).getTotalWidth())) && + (this.getIntegerWidth() == ((FixedPointTypeParam)other).getIntegerWidth())) && + Objects.equal(this.getQuantificationMode(), ((FixedPointTypeParam)other).getQuantificationMode())) && + Objects.equal(this.getOverflowMode(), ((FixedPointTypeParam)other).getOverflowMode())); + } + else { + _xifexpression = false; + } + return _xifexpression; + } + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -264,14 +287,15 @@ public class FixedPointTypeParamImpl extends TypeParamImpl implements FixedPoint public String toString() { String _xifexpression = null; boolean _isSigned = this.isSigned(); - if (_isSigned) { - _xifexpression = "signed"; + boolean _not = (!_isSigned); + if (_not) { + _xifexpression = "un"; } else { _xifexpression = ""; } String _plus = ("Fixed-point type: " + _xifexpression); - String _plus_1 = (_plus + " W="); + String _plus_1 = (_plus + "signed W="); int _totalWidth = this.getTotalWidth(); String _plus_2 = (_plus_1 + Integer.valueOf(_totalWidth)); String _plus_3 = (_plus_2 + " I="); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FloatPointTypeConfigurationImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FloatPointTypeConfigurationImpl.java index 03b9b41b8c0ea5cc9a424cb9f311ffac31760121..39c302c312228086df174e5ff13187c75e613ae9 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FloatPointTypeConfigurationImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FloatPointTypeConfigurationImpl.java @@ -9,7 +9,6 @@ import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; -import org.eclipse.emf.ecore.util.EcoreUtil; import typeexploration.FloatPointTypeConfiguration; import typeexploration.TypeexplorationPackage; @@ -22,24 +21,13 @@ import typeexploration.TypeexplorationPackage; * The following features are implemented: * </p> * <ul> - * <li>{@link typeexploration.impl.FloatPointTypeConfigurationImpl#getTotalWidthValues <em>Total Width Values</em>}</li> * <li>{@link typeexploration.impl.FloatPointTypeConfigurationImpl#getExponentWidthValues <em>Exponent Width Values</em>}</li> * <li>{@link typeexploration.impl.FloatPointTypeConfigurationImpl#getBiasValues <em>Bias Values</em>}</li> * </ul> * * @generated */ -public class FloatPointTypeConfigurationImpl extends TypeConfigurationImpl implements FloatPointTypeConfiguration { - /** - * The cached value of the '{@link #getTotalWidthValues() <em>Total Width Values</em>}' attribute list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getTotalWidthValues() - * @generated - * @ordered - */ - protected EList<Integer> totalWidthValues; - +public class FloatPointTypeConfigurationImpl extends NumberTypeConfigurationImpl implements FloatPointTypeConfiguration { /** * The cached value of the '{@link #getExponentWidthValues() <em>Exponent Width Values</em>}' attribute list. * <!-- begin-user-doc --> @@ -79,18 +67,6 @@ public class FloatPointTypeConfigurationImpl extends TypeConfigurationImpl imple return TypeexplorationPackage.Literals.FLOAT_POINT_TYPE_CONFIGURATION; } - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList<Integer> getTotalWidthValues() { - if (totalWidthValues == null) { - totalWidthValues = new EDataTypeUniqueEList<Integer>(Integer.class, this, TypeexplorationPackage.FLOAT_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES); - } - return totalWidthValues; - } - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -121,32 +97,26 @@ public class FloatPointTypeConfigurationImpl extends TypeConfigurationImpl imple * @generated */ public FloatPointTypeConfiguration mergeIn(final FloatPointTypeConfiguration c) { - this.getTotalWidthValues().addAll(c.getTotalWidthValues()); + super.mergeIn(c); this.getExponentWidthValues().addAll(c.getExponentWidthValues()); this.getBiasValues().addAll(c.getBiasValues()); return this; } - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public FloatPointTypeConfiguration copy() { - return EcoreUtil.<FloatPointTypeConfiguration>copy(this); - } - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String toString() { + EList<Boolean> _signed = this.getSigned(); + String _plus = ("Floating-point: S=" + _signed); + String _plus_1 = (_plus + " W="); EList<Integer> _totalWidthValues = this.getTotalWidthValues(); - String _plus = ("Floating-point: W=" + _totalWidthValues); - String _plus_1 = (_plus + " E="); + String _plus_2 = (_plus_1 + _totalWidthValues); + String _plus_3 = (_plus_2 + " E="); EList<Integer> _exponentWidthValues = this.getExponentWidthValues(); - return (_plus_1 + _exponentWidthValues); + return (_plus_3 + _exponentWidthValues); } /** @@ -157,8 +127,6 @@ public class FloatPointTypeConfigurationImpl extends TypeConfigurationImpl imple @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case TypeexplorationPackage.FLOAT_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES: - return getTotalWidthValues(); case TypeexplorationPackage.FLOAT_POINT_TYPE_CONFIGURATION__EXPONENT_WIDTH_VALUES: return getExponentWidthValues(); case TypeexplorationPackage.FLOAT_POINT_TYPE_CONFIGURATION__BIAS_VALUES: @@ -176,10 +144,6 @@ public class FloatPointTypeConfigurationImpl extends TypeConfigurationImpl imple @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case TypeexplorationPackage.FLOAT_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES: - getTotalWidthValues().clear(); - getTotalWidthValues().addAll((Collection<? extends Integer>)newValue); - return; case TypeexplorationPackage.FLOAT_POINT_TYPE_CONFIGURATION__EXPONENT_WIDTH_VALUES: getExponentWidthValues().clear(); getExponentWidthValues().addAll((Collection<? extends Integer>)newValue); @@ -200,9 +164,6 @@ public class FloatPointTypeConfigurationImpl extends TypeConfigurationImpl imple @Override public void eUnset(int featureID) { switch (featureID) { - case TypeexplorationPackage.FLOAT_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES: - getTotalWidthValues().clear(); - return; case TypeexplorationPackage.FLOAT_POINT_TYPE_CONFIGURATION__EXPONENT_WIDTH_VALUES: getExponentWidthValues().clear(); return; @@ -221,8 +182,6 @@ public class FloatPointTypeConfigurationImpl extends TypeConfigurationImpl imple @Override public boolean eIsSet(int featureID) { switch (featureID) { - case TypeexplorationPackage.FLOAT_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES: - return totalWidthValues != null && !totalWidthValues.isEmpty(); case TypeexplorationPackage.FLOAT_POINT_TYPE_CONFIGURATION__EXPONENT_WIDTH_VALUES: return exponentWidthValues != null && !exponentWidthValues.isEmpty(); case TypeexplorationPackage.FLOAT_POINT_TYPE_CONFIGURATION__BIAS_VALUES: diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FloatPointTypeParamImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FloatPointTypeParamImpl.java index e50be68e2abff899e19f951d62c602edbbb53549..9368a49c79d2042c77122ccc33f3ca2af7eed99f 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FloatPointTypeParamImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/FloatPointTypeParamImpl.java @@ -9,6 +9,7 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import typeexploration.FloatPointTypeParam; +import typeexploration.TypeParam; import typeexploration.TypeexplorationPackage; /** @@ -211,6 +212,25 @@ public class FloatPointTypeParamImpl extends TypeParamImpl implements FloatPoint eNotify(new ENotificationImpl(this, Notification.SET, TypeexplorationPackage.FLOAT_POINT_TYPE_PARAM__EXPONENT_BIAS, oldExponentBias, exponentBias)); } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean equals(final TypeParam other) { + boolean _xifexpression = false; + if ((other instanceof FloatPointTypeParam)) { + _xifexpression = ((((this.isSigned() == ((FloatPointTypeParam)other).isSigned()) && + (this.getTotalWidth() == ((FloatPointTypeParam)other).getTotalWidth())) && + (this.getExponentWidth() == ((FloatPointTypeParam)other).getExponentWidth())) && + (this.getExponentBias() == ((FloatPointTypeParam)other).getExponentBias())); + } + else { + _xifexpression = false; + } + return _xifexpression; + } + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -219,14 +239,15 @@ public class FloatPointTypeParamImpl extends TypeParamImpl implements FloatPoint public String toString() { String _xifexpression = null; boolean _isSigned = this.isSigned(); - if (_isSigned) { - _xifexpression = "signed"; + boolean _not = (!_isSigned); + if (_not) { + _xifexpression = "un"; } else { _xifexpression = ""; } String _plus = ("Floating-point type:" + _xifexpression); - String _plus_1 = (_plus + " W="); + String _plus_1 = (_plus + "signed W="); int _totalWidth = this.getTotalWidth(); String _plus_2 = (_plus_1 + Integer.valueOf(_totalWidth)); String _plus_3 = (_plus_2 + " E="); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/NumberTypeConfigurationImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/NumberTypeConfigurationImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..582c0d8f232c6b9bf0d54eb41e1eea3c34358aa1 --- /dev/null +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/NumberTypeConfigurationImpl.java @@ -0,0 +1,206 @@ +/** + */ +package typeexploration.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; +import org.eclipse.emf.ecore.util.EcoreUtil; + +import typeexploration.NumberTypeConfiguration; +import typeexploration.TypeexplorationPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Number Type Configuration</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link typeexploration.impl.NumberTypeConfigurationImpl#getSigned <em>Signed</em>}</li> + * <li>{@link typeexploration.impl.NumberTypeConfigurationImpl#getTotalWidthValues <em>Total Width Values</em>}</li> + * </ul> + * + * @generated + */ +public abstract class NumberTypeConfigurationImpl extends MinimalEObjectImpl.Container implements NumberTypeConfiguration { + /** + * The cached value of the '{@link #getSigned() <em>Signed</em>}' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getSigned() + * @generated + * @ordered + */ + protected EList<Boolean> signed; + + /** + * The cached value of the '{@link #getTotalWidthValues() <em>Total Width Values</em>}' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getTotalWidthValues() + * @generated + * @ordered + */ + protected EList<Integer> totalWidthValues; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected NumberTypeConfigurationImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return TypeexplorationPackage.Literals.NUMBER_TYPE_CONFIGURATION; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<Boolean> getSigned() { + if (signed == null) { + signed = new EDataTypeUniqueEList<Boolean>(Boolean.class, this, TypeexplorationPackage.NUMBER_TYPE_CONFIGURATION__SIGNED); + } + return signed; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<Integer> getTotalWidthValues() { + if (totalWidthValues == null) { + totalWidthValues = new EDataTypeUniqueEList<Integer>(Integer.class, this, TypeexplorationPackage.NUMBER_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES); + } + return totalWidthValues; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NumberTypeConfiguration mergeIn(final NumberTypeConfiguration c) { + this.getSigned().addAll(c.getSigned()); + this.getTotalWidthValues().addAll(c.getTotalWidthValues()); + return this; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NumberTypeConfiguration copy() { + return EcoreUtil.<NumberTypeConfiguration>copy(this); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case TypeexplorationPackage.NUMBER_TYPE_CONFIGURATION__SIGNED: + return getSigned(); + case TypeexplorationPackage.NUMBER_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES: + return getTotalWidthValues(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case TypeexplorationPackage.NUMBER_TYPE_CONFIGURATION__SIGNED: + getSigned().clear(); + getSigned().addAll((Collection<? extends Boolean>)newValue); + return; + case TypeexplorationPackage.NUMBER_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES: + getTotalWidthValues().clear(); + getTotalWidthValues().addAll((Collection<? extends Integer>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case TypeexplorationPackage.NUMBER_TYPE_CONFIGURATION__SIGNED: + getSigned().clear(); + return; + case TypeexplorationPackage.NUMBER_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES: + getTotalWidthValues().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case TypeexplorationPackage.NUMBER_TYPE_CONFIGURATION__SIGNED: + return signed != null && !signed.isEmpty(); + case TypeexplorationPackage.NUMBER_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES: + return totalWidthValues != null && !totalWidthValues.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (signed: "); + result.append(signed); + result.append(", totalWidthValues: "); + result.append(totalWidthValues); + result.append(')'); + return result.toString(); + } + +} //NumberTypeConfigurationImpl diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/SolutionSpaceImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/SolutionSpaceImpl.java index a22130a97cf7bad345bffdbb7c792229dea858bd..eced02ad1eac9db7aef7c7a1964d4202f4fafcaa 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/SolutionSpaceImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/SolutionSpaceImpl.java @@ -12,6 +12,8 @@ import gecos.core.Symbol; import gecos.gecosproject.GecosProject; +import java.lang.CharSequence; + import java.util.Collections; import java.util.Map.Entry; @@ -408,6 +410,19 @@ public class SolutionSpaceImpl extends MinimalEObjectImpl.Container implements S return EcoreUtil.<SolutionSpace>copy(this); } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getUniqueTypeName(final Symbol s) { + String _name = s.getName(); + String _plus = ("TYPE_" + _name); + String _plus_1 = (_plus + "_"); + int _indexOfKey = this.getExploredSymbols().indexOfKey(s); + return (_plus_1 + Integer.valueOf(_indexOfKey)); + } + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeConfigurationImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeConfigurationImpl.java deleted file mode 100644 index 3e68430256aa3cf31ff99faf5fd3b9bac7e73b2a..0000000000000000000000000000000000000000 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeConfigurationImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - */ -package typeexploration.impl; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import typeexploration.TypeConfiguration; -import typeexploration.TypeexplorationPackage; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Type Configuration</b></em>'. - * <!-- end-user-doc --> - * - * @generated - */ -public abstract class TypeConfigurationImpl extends MinimalEObjectImpl.Container implements TypeConfiguration { - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected TypeConfigurationImpl() { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - protected EClass eStaticClass() { - return TypeexplorationPackage.Literals.TYPE_CONFIGURATION; - } - -} //TypeConfigurationImpl diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeConfigurationSpaceImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeConfigurationSpaceImpl.java index c4c7f2a0cdb16c16eeb7fad9f2a6b943569ae826..ececca412bf0ca725e2bcf8fd985745230c44e75 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeConfigurationSpaceImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeConfigurationSpaceImpl.java @@ -2,6 +2,8 @@ */ package typeexploration.impl; +import java.lang.CharSequence; + import java.security.InvalidParameterException; import java.util.Collection; diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeParamImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeParamImpl.java index d131b75a373d9ea3a7703fed004106db6a547b5d..fd9c89ea5b25f092edde9d144cab1992b1d1cf69 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeParamImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeParamImpl.java @@ -47,4 +47,15 @@ public abstract class TypeParamImpl extends MinimalEObjectImpl.Container impleme throw new UnsupportedOperationException(); } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean equals(TypeParam other) { + // TODO: implement this method + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + } //TypeParamImpl diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeexplorationPackageImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeexplorationPackageImpl.java index e04602c91c698220c4780f09e8872670d7e43a98..777281f1286138642a4c9bd023f3a4c2ba1c66bf 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeexplorationPackageImpl.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/impl/TypeexplorationPackageImpl.java @@ -35,6 +35,7 @@ import typeexploration.FixedPointTypeParam; import typeexploration.FloatPointTypeConfiguration; import typeexploration.FloatPointTypeParam; import typeexploration.GenericTypeParam; +import typeexploration.NumberTypeConfiguration; import typeexploration.SameTypeConstraint; import typeexploration.SolutionSpace; import typeexploration.TypeConfiguration; @@ -100,6 +101,13 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl */ private EClass typeConfigurationEClass = null; + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass numberTypeConfigurationEClass = null; + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -170,7 +178,7 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl /** * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. - * + * * <p>This method is used to initialize {@link TypeexplorationPackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * <!-- begin-user-doc --> @@ -184,8 +192,7 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl if (isInited) return (TypeexplorationPackage)EPackage.Registry.INSTANCE.getEPackage(TypeexplorationPackage.eNS_URI); // Obtain or create and register package - Object registeredTypeexplorationPackage = EPackage.Registry.INSTANCE.get(eNS_URI); - TypeexplorationPackageImpl theTypeexplorationPackage = registeredTypeexplorationPackage instanceof TypeexplorationPackageImpl ? (TypeexplorationPackageImpl)registeredTypeexplorationPackage : new TypeexplorationPackageImpl(); + TypeexplorationPackageImpl theTypeexplorationPackage = (TypeexplorationPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof TypeexplorationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new TypeexplorationPackageImpl()); isInited = true; @@ -208,6 +215,7 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl // Mark meta-data to indicate it can't be changed theTypeexplorationPackage.freeze(); + // Update the registry and return the package EPackage.Registry.INSTANCE.put(TypeexplorationPackage.eNS_URI, theTypeexplorationPackage); return theTypeexplorationPackage; @@ -380,8 +388,8 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl * <!-- end-user-doc --> * @generated */ - public EClass getFixedPointTypeConfiguration() { - return fixedPointTypeConfigurationEClass; + public EClass getNumberTypeConfiguration() { + return numberTypeConfigurationEClass; } /** @@ -389,8 +397,8 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl * <!-- end-user-doc --> * @generated */ - public EAttribute getFixedPointTypeConfiguration_TotalWidthValues() { - return (EAttribute)fixedPointTypeConfigurationEClass.getEStructuralFeatures().get(0); + public EAttribute getNumberTypeConfiguration_Signed() { + return (EAttribute)numberTypeConfigurationEClass.getEStructuralFeatures().get(0); } /** @@ -398,8 +406,8 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl * <!-- end-user-doc --> * @generated */ - public EAttribute getFixedPointTypeConfiguration_IntegerWidthValues() { - return (EAttribute)fixedPointTypeConfigurationEClass.getEStructuralFeatures().get(1); + public EAttribute getNumberTypeConfiguration_TotalWidthValues() { + return (EAttribute)numberTypeConfigurationEClass.getEStructuralFeatures().get(1); } /** @@ -407,8 +415,8 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl * <!-- end-user-doc --> * @generated */ - public EAttribute getFixedPointTypeConfiguration_QuantificationMode() { - return (EAttribute)fixedPointTypeConfigurationEClass.getEStructuralFeatures().get(2); + public EClass getFixedPointTypeConfiguration() { + return fixedPointTypeConfigurationEClass; } /** @@ -416,8 +424,8 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl * <!-- end-user-doc --> * @generated */ - public EAttribute getFixedPointTypeConfiguration_OverflowMode() { - return (EAttribute)fixedPointTypeConfigurationEClass.getEStructuralFeatures().get(3); + public EAttribute getFixedPointTypeConfiguration_IntegerWidthValues() { + return (EAttribute)fixedPointTypeConfigurationEClass.getEStructuralFeatures().get(0); } /** @@ -425,8 +433,8 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl * <!-- end-user-doc --> * @generated */ - public EClass getFloatPointTypeConfiguration() { - return floatPointTypeConfigurationEClass; + public EAttribute getFixedPointTypeConfiguration_QuantificationMode() { + return (EAttribute)fixedPointTypeConfigurationEClass.getEStructuralFeatures().get(1); } /** @@ -434,8 +442,17 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl * <!-- end-user-doc --> * @generated */ - public EAttribute getFloatPointTypeConfiguration_TotalWidthValues() { - return (EAttribute)floatPointTypeConfigurationEClass.getEStructuralFeatures().get(0); + public EAttribute getFixedPointTypeConfiguration_OverflowMode() { + return (EAttribute)fixedPointTypeConfigurationEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getFloatPointTypeConfiguration() { + return floatPointTypeConfigurationEClass; } /** @@ -444,7 +461,7 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl * @generated */ public EAttribute getFloatPointTypeConfiguration_ExponentWidthValues() { - return (EAttribute)floatPointTypeConfigurationEClass.getEStructuralFeatures().get(1); + return (EAttribute)floatPointTypeConfigurationEClass.getEStructuralFeatures().get(0); } /** @@ -453,7 +470,7 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl * @generated */ public EAttribute getFloatPointTypeConfiguration_BiasValues() { - return (EAttribute)floatPointTypeConfigurationEClass.getEStructuralFeatures().get(2); + return (EAttribute)floatPointTypeConfigurationEClass.getEStructuralFeatures().get(1); } /** @@ -626,14 +643,16 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl typeConfigurationEClass = createEClass(TYPE_CONFIGURATION); + numberTypeConfigurationEClass = createEClass(NUMBER_TYPE_CONFIGURATION); + createEAttribute(numberTypeConfigurationEClass, NUMBER_TYPE_CONFIGURATION__SIGNED); + createEAttribute(numberTypeConfigurationEClass, NUMBER_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES); + fixedPointTypeConfigurationEClass = createEClass(FIXED_POINT_TYPE_CONFIGURATION); - createEAttribute(fixedPointTypeConfigurationEClass, FIXED_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES); createEAttribute(fixedPointTypeConfigurationEClass, FIXED_POINT_TYPE_CONFIGURATION__INTEGER_WIDTH_VALUES); createEAttribute(fixedPointTypeConfigurationEClass, FIXED_POINT_TYPE_CONFIGURATION__QUANTIFICATION_MODE); createEAttribute(fixedPointTypeConfigurationEClass, FIXED_POINT_TYPE_CONFIGURATION__OVERFLOW_MODE); floatPointTypeConfigurationEClass = createEClass(FLOAT_POINT_TYPE_CONFIGURATION); - createEAttribute(floatPointTypeConfigurationEClass, FLOAT_POINT_TYPE_CONFIGURATION__TOTAL_WIDTH_VALUES); createEAttribute(floatPointTypeConfigurationEClass, FLOAT_POINT_TYPE_CONFIGURATION__EXPONENT_WIDTH_VALUES); createEAttribute(floatPointTypeConfigurationEClass, FLOAT_POINT_TYPE_CONFIGURATION__BIAS_VALUES); @@ -694,14 +713,18 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl floatPointTypeParamEClass.getESuperTypes().add(this.getTypeParam()); genericTypeParamEClass.getESuperTypes().add(this.getTypeParam()); sameTypeConstraintEClass.getESuperTypes().add(this.getTypeConstraint()); - fixedPointTypeConfigurationEClass.getESuperTypes().add(this.getTypeConfiguration()); - floatPointTypeConfigurationEClass.getESuperTypes().add(this.getTypeConfiguration()); + numberTypeConfigurationEClass.getESuperTypes().add(this.getTypeConfiguration()); + fixedPointTypeConfigurationEClass.getESuperTypes().add(this.getNumberTypeConfiguration()); + floatPointTypeConfigurationEClass.getESuperTypes().add(this.getNumberTypeConfiguration()); // Initialize classes and features; add operations and parameters initEClass(typeParamEClass, TypeParam.class, "TypeParam", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); addEOperation(typeParamEClass, theEcorePackage.getEInt(), "getTotalWidth", 0, 1, !IS_UNIQUE, IS_ORDERED); + EOperation op = addEOperation(typeParamEClass, theEcorePackage.getEBoolean(), "equals", 0, 1, !IS_UNIQUE, IS_ORDERED); + addEParameter(op, this.getTypeParam(), "other", 0, 1, !IS_UNIQUE, IS_ORDERED); + initEClass(fixedPointTypeParamEClass, FixedPointTypeParam.class, "FixedPointTypeParam", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getFixedPointTypeParam_Signed(), theEcorePackage.getEBoolean(), "signed", "true", 0, 1, FixedPointTypeParam.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getFixedPointTypeParam_TotalWidth(), theEcorePackage.getEInt(), "totalWidth", null, 0, 1, FixedPointTypeParam.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -709,6 +732,9 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl initEAttribute(getFixedPointTypeParam_QuantificationMode(), theTypesPackage.getQuantificationMode(), "quantificationMode", null, 0, 1, FixedPointTypeParam.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getFixedPointTypeParam_OverflowMode(), theTypesPackage.getOverflowMode(), "overflowMode", null, 0, 1, FixedPointTypeParam.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + op = addEOperation(fixedPointTypeParamEClass, theEcorePackage.getEBoolean(), "equals", 0, 1, !IS_UNIQUE, IS_ORDERED); + addEParameter(op, this.getTypeParam(), "other", 0, 1, !IS_UNIQUE, IS_ORDERED); + addEOperation(fixedPointTypeParamEClass, theEcorePackage.getEString(), "toString", 0, 1, !IS_UNIQUE, IS_ORDERED); initEClass(floatPointTypeParamEClass, FloatPointTypeParam.class, "FloatPointTypeParam", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -717,6 +743,9 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl initEAttribute(getFloatPointTypeParam_ExponentWidth(), theEcorePackage.getEInt(), "exponentWidth", null, 0, 1, FloatPointTypeParam.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getFloatPointTypeParam_ExponentBias(), theEcorePackage.getEInt(), "exponentBias", null, 0, 1, FloatPointTypeParam.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + op = addEOperation(floatPointTypeParamEClass, theEcorePackage.getEBoolean(), "equals", 0, 1, !IS_UNIQUE, IS_ORDERED); + addEParameter(op, this.getTypeParam(), "other", 0, 1, !IS_UNIQUE, IS_ORDERED); + addEOperation(floatPointTypeParamEClass, theEcorePackage.getEString(), "toString", 0, 1, !IS_UNIQUE, IS_ORDERED); initEClass(genericTypeParamEClass, GenericTypeParam.class, "GenericTypeParam", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -733,31 +762,34 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl addEOperation(sameTypeConstraintEClass, theEcorePackage.getEString(), "toString", 0, 1, !IS_UNIQUE, IS_ORDERED); - initEClass(typeConfigurationEClass, TypeConfiguration.class, "TypeConfiguration", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(typeConfigurationEClass, TypeConfiguration.class, "TypeConfiguration", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(numberTypeConfigurationEClass, NumberTypeConfiguration.class, "NumberTypeConfiguration", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getNumberTypeConfiguration_Signed(), theEcorePackage.getEBoolean(), "signed", null, 0, -1, NumberTypeConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getNumberTypeConfiguration_TotalWidthValues(), theEcorePackage.getEInt(), "totalWidthValues", null, 0, -1, NumberTypeConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + op = addEOperation(numberTypeConfigurationEClass, this.getNumberTypeConfiguration(), "mergeIn", 0, 1, !IS_UNIQUE, IS_ORDERED); + addEParameter(op, this.getNumberTypeConfiguration(), "c", 0, 1, !IS_UNIQUE, IS_ORDERED); + + addEOperation(numberTypeConfigurationEClass, this.getNumberTypeConfiguration(), "copy", 0, 1, !IS_UNIQUE, IS_ORDERED); initEClass(fixedPointTypeConfigurationEClass, FixedPointTypeConfiguration.class, "FixedPointTypeConfiguration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getFixedPointTypeConfiguration_TotalWidthValues(), theEcorePackage.getEInt(), "totalWidthValues", null, 0, -1, FixedPointTypeConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getFixedPointTypeConfiguration_IntegerWidthValues(), theEcorePackage.getEInt(), "integerWidthValues", null, 0, -1, FixedPointTypeConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getFixedPointTypeConfiguration_QuantificationMode(), theTypesPackage.getQuantificationMode(), "quantificationMode", null, 0, -1, FixedPointTypeConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getFixedPointTypeConfiguration_OverflowMode(), theTypesPackage.getOverflowMode(), "overflowMode", null, 0, -1, FixedPointTypeConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - EOperation op = addEOperation(fixedPointTypeConfigurationEClass, this.getFixedPointTypeConfiguration(), "mergeIn", 0, 1, !IS_UNIQUE, IS_ORDERED); + op = addEOperation(fixedPointTypeConfigurationEClass, this.getFixedPointTypeConfiguration(), "mergeIn", 0, 1, !IS_UNIQUE, IS_ORDERED); addEParameter(op, this.getFixedPointTypeConfiguration(), "c", 0, 1, !IS_UNIQUE, IS_ORDERED); - addEOperation(fixedPointTypeConfigurationEClass, this.getFixedPointTypeConfiguration(), "copy", 0, 1, !IS_UNIQUE, IS_ORDERED); - addEOperation(fixedPointTypeConfigurationEClass, theEcorePackage.getEString(), "toString", 0, 1, !IS_UNIQUE, IS_ORDERED); initEClass(floatPointTypeConfigurationEClass, FloatPointTypeConfiguration.class, "FloatPointTypeConfiguration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getFloatPointTypeConfiguration_TotalWidthValues(), theEcorePackage.getEInt(), "totalWidthValues", null, 0, -1, FloatPointTypeConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getFloatPointTypeConfiguration_ExponentWidthValues(), theEcorePackage.getEInt(), "exponentWidthValues", null, 0, -1, FloatPointTypeConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getFloatPointTypeConfiguration_BiasValues(), theEcorePackage.getEInt(), "biasValues", null, 0, -1, FloatPointTypeConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); op = addEOperation(floatPointTypeConfigurationEClass, this.getFloatPointTypeConfiguration(), "mergeIn", 0, 1, !IS_UNIQUE, IS_ORDERED); addEParameter(op, this.getFloatPointTypeConfiguration(), "c", 0, 1, !IS_UNIQUE, IS_ORDERED); - addEOperation(floatPointTypeConfigurationEClass, this.getFloatPointTypeConfiguration(), "copy", 0, 1, !IS_UNIQUE, IS_ORDERED); - addEOperation(floatPointTypeConfigurationEClass, theEcorePackage.getEString(), "toString", 0, 1, !IS_UNIQUE, IS_ORDERED); initEClass(typeConfigurationSpaceEClass, TypeConfigurationSpace.class, "TypeConfigurationSpace", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -818,6 +850,9 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl addEOperation(solutionSpaceEClass, this.getSolutionSpace(), "copy", 0, 1, !IS_UNIQUE, IS_ORDERED); + op = addEOperation(solutionSpaceEClass, theEcorePackage.getEString(), "getUniqueTypeName", 0, 1, !IS_UNIQUE, IS_ORDERED); + addEParameter(op, theCorePackage.getSymbol(), "s", 0, 1, !IS_UNIQUE, IS_ORDERED); + addEOperation(solutionSpaceEClass, theEcorePackage.getEString(), "toString", 0, 1, !IS_UNIQUE, IS_ORDERED); // Initialize data types @@ -825,6 +860,25 @@ public class TypeexplorationPackageImpl extends EPackageImpl implements Typeexpl // Create resource createResource(eNS_URI); + + // Create annotations + // http://www.eclipse.org/emf/2002/Ecore + createEcoreAnnotations(); + } + + /** + * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void createEcoreAnnotations() { + String source = "http://www.eclipse.org/emf/2002/Ecore"; + addAnnotation + (this, + source, + new String[] { + }); } } //TypeexplorationPackageImpl diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/util/TypeexplorationAdapterFactory.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/util/TypeexplorationAdapterFactory.java index 3dd6640fe86ea5b3dd703edad11b2fe48dfec317..2843a68d5b511c61f782ac47038fac43bff3a71b 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/util/TypeexplorationAdapterFactory.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/util/TypeexplorationAdapterFactory.java @@ -100,6 +100,10 @@ public class TypeexplorationAdapterFactory extends AdapterFactoryImpl { return createTypeConfigurationAdapter(); } @Override + public Adapter caseNumberTypeConfiguration(NumberTypeConfiguration object) { + return createNumberTypeConfigurationAdapter(); + } + @Override public Adapter caseFixedPointTypeConfiguration(FixedPointTypeConfiguration object) { return createFixedPointTypeConfigurationAdapter(); } @@ -237,6 +241,20 @@ public class TypeexplorationAdapterFactory extends AdapterFactoryImpl { return null; } + /** + * Creates a new adapter for an object of class '{@link typeexploration.NumberTypeConfiguration <em>Number Type Configuration</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see typeexploration.NumberTypeConfiguration + * @generated + */ + public Adapter createNumberTypeConfigurationAdapter() { + return null; + } + /** * Creates a new adapter for an object of class '{@link typeexploration.FixedPointTypeConfiguration <em>Fixed Point Type Configuration</em>}'. * <!-- begin-user-doc --> diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/util/TypeexplorationSwitch.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/util/TypeexplorationSwitch.java index 84891639178dce9fa503115983a2772f620dc28a..5298172c312f20618d781500759a2270a166fe50 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/util/TypeexplorationSwitch.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src-gen/typeexploration/util/TypeexplorationSwitch.java @@ -116,9 +116,17 @@ public class TypeexplorationSwitch<T> extends Switch<T> { if (result == null) result = defaultCase(theEObject); return result; } + case TypeexplorationPackage.NUMBER_TYPE_CONFIGURATION: { + NumberTypeConfiguration numberTypeConfiguration = (NumberTypeConfiguration)theEObject; + T result = caseNumberTypeConfiguration(numberTypeConfiguration); + if (result == null) result = caseTypeConfiguration(numberTypeConfiguration); + if (result == null) result = defaultCase(theEObject); + return result; + } case TypeexplorationPackage.FIXED_POINT_TYPE_CONFIGURATION: { FixedPointTypeConfiguration fixedPointTypeConfiguration = (FixedPointTypeConfiguration)theEObject; T result = caseFixedPointTypeConfiguration(fixedPointTypeConfiguration); + if (result == null) result = caseNumberTypeConfiguration(fixedPointTypeConfiguration); if (result == null) result = caseTypeConfiguration(fixedPointTypeConfiguration); if (result == null) result = defaultCase(theEObject); return result; @@ -126,6 +134,7 @@ public class TypeexplorationSwitch<T> extends Switch<T> { case TypeexplorationPackage.FLOAT_POINT_TYPE_CONFIGURATION: { FloatPointTypeConfiguration floatPointTypeConfiguration = (FloatPointTypeConfiguration)theEObject; T result = caseFloatPointTypeConfiguration(floatPointTypeConfiguration); + if (result == null) result = caseNumberTypeConfiguration(floatPointTypeConfiguration); if (result == null) result = caseTypeConfiguration(floatPointTypeConfiguration); if (result == null) result = defaultCase(theEObject); return result; @@ -257,6 +266,21 @@ public class TypeexplorationSwitch<T> extends Switch<T> { return null; } + /** + * Returns the result of interpreting the object as an instance of '<em>Number Type Configuration</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Number Type Configuration</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseNumberTypeConfiguration(NumberTypeConfiguration object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of '<em>Fixed Point Type Configuration</em>'. * <!-- begin-user-doc --> diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/SSIMEvaluatorForFiles.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/SSIMEvaluatorForFiles.java index 42e0b3afb34d480f08ce6a65995ba84d14c431d3..404ad24e9c369a37b2a79ad8ac5ebe6cbbdd8d7d 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/SSIMEvaluatorForFiles.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/SSIMEvaluatorForFiles.java @@ -19,11 +19,11 @@ public class SSIMEvaluatorForFiles { Path path1 = Paths.get("/Users/tyuki/projects/GeCoS/gecos-float2fix/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/outputs/nlm/2018-09-12-10:54:32/exploration/simulations/ref/profiling-files"); Path path2 = Paths.get("/Users/tyuki/projects/GeCoS/gecos-float2fix/bundles/fr.irisa.cairn.gecos.typeexploration.demo/demos/nlm_png/outputs/nlm/2018-09-12-10:54:32/exploration/simulations/sol1/profiling-files"); - double ssim = evaluate(384, 512, path1, path2); + double ssim = evaluate(384, 512, path1, path2, 1); System.out.println(ssim); } - private static double evaluate(int H, int W, Path dir1, Path dir2) { + private static double evaluate(int H, int W, Path dir1, Path dir2, int nbSims) { try { Map<Integer, ProfilingInfo<? extends Number>> variablesInfo1 = new ProfilingInfoParser(dir1).retrieve(); @@ -35,12 +35,17 @@ public class SSIMEvaluatorForFiles { ProfilingInfo<? extends Number> profilingInfo1 = variablesInfo1.values().iterator().next(); ProfilingInfo<? extends Number> profilingInfo2 = variablesInfo2.values().iterator().next(); + + double ssim = 1.0; + for (int i = 0; i < nbSims; i++) { + Number[] array1 = profilingInfo1.getSnapshot(i); + Number[] array2 = profilingInfo2.getSnapshot(i); + + SSIMEvaluator ssimEval = new SSIMEvaluator(W, H, array1, array2); + ssim = Math.min(ssim, ssimEval.evaluate()); + } - Number[] array1 = profilingInfo1.getSnapshot(0); - Number[] array2 = profilingInfo2.getSnapshot(0); - - SSIMEvaluator ssimEval = new SSIMEvaluator(W, H, array1, array2); - return ssimEval.evaluate(); + return ssim; } catch(Exception e) { e.printStackTrace(); } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/Components.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/Components.java index 3e6ffcffa61a609825ea49d7557b47bffe607447..f6f6fb26a609bdc5be4c4ca6dcdddd252607db16 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/Components.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/Components.java @@ -22,6 +22,7 @@ public class Components { OutputLocations outputLoc; Logger mainLogger; Logger expLogger; + Logger expStatsLogger; // int maxNbThreads; Configuration configuration; @@ -90,6 +91,10 @@ public class Components { public Logger getExploartionLogger() { return instance.expLogger; } + + public Logger getExploartionStatsLogger() { + return instance.expStatsLogger; + } public IAccuracyMetricCalculator getAccuracyMetricCalculator() { return instance.accuracyMetricCalculator; diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/Configuration.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/Configuration.java index 030663a5585752cfaea5b563b3c640eb0ca205dd..30fd13d52a61e0df51c8ef621f50ab6e65cf5bb6 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/Configuration.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/Configuration.java @@ -3,17 +3,23 @@ package fr.irisa.cairn.gecos.typeexploration; import static fr.irisa.cairn.gecos.model.utils.misc.StreamUtils.join; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.ACCURACY_METRIC; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.ACCURACY_THRESHOLD; +import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.CC; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.COST_METRIC; +import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.COST_MODEL_FILEPATH; +import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.COST_MODEL_FLAGS; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.DEFAULT_FIXED_I; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.DEFAULT_FIXED_W; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.DEFAULT_FLOAT_E; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.DEFAULT_FLOAT_W; +import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.DEFAULT_SIGN; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.DO_PRUNING_FIRST; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.DO_TAG_OUTPUT; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.ENABLE_CHARTS; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.EXPLORATION_ALGO; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.EXPLORATION_MODE; +import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.EXPLORATION_FLAGS; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.EXPL_LOG_LEVEL; +import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.EXTRA_CFLAGS; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.MAIN_LOG_LEVEL; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.N_KEEP_OUTPUT; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.N_THREADS; @@ -21,6 +27,7 @@ import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.SNAPSH import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.SSIM_ENABLED; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.SSIM_TARGET; import static fr.irisa.cairn.gecos.typeexploration.Configuration.Property.SYMBOLS_ERROR_MERGE; +import static fr.irisa.cairn.gecos.typeexploration.GlobalParameters.LOG_MAIN; import static java.util.Arrays.stream; import static java.util.stream.Collectors.toList; @@ -34,6 +41,7 @@ import java.util.Map; import java.util.Properties; import java.util.function.Function; import java.util.logging.Level; +import java.util.logging.Logger; import java.util.stream.Stream; import com.google.common.collect.Streams; @@ -56,6 +64,14 @@ public class Configuration { protected Properties properties; enum Property { + CC("CC", "g++", + "Compiler used during profiling. The current simulation based profiler assumes gcc/g++ options are accepted."), + EXTRA_CFLAGS("EXTRA_CFLAGS", "-O2 -Wno-everything", + "Additional compiler flags to be used during profiling runs."), + COST_MODEL_FILEPATH("COST_MODEL_DSL", "", + "Path to DSL that specify model of computation used in cost models."), + COST_MODEL_FLAGS("COST_MODEL_FLAGS", "", + "Additional flags to be used for cost models. Use group=<group name> to specify a pre-defined group to include in the cost calculation."), N_THREADS("nbThreads", "C", "Max number of threads to be used: Positive integer value or C to match available Processors"), N_SIMULATIONS("nbSimulations", "1", @@ -64,9 +80,9 @@ public class Configuration { ENABLE_CHARTS("enableCharts", "true", "If false no charts will be created/displayed during exploration: [true, false]"), MAIN_LOG_LEVEL("mainLogLevel", "ALL", - "Logging level for the main logger: [SEVERE, WARNING, INFO, FINE, ALL]"), + "Logging level for the main logger: [OFF, SEVERE, WARNING, CONFIG, INFO, FINE, FINER, FINEST, ALL]"), EXPL_LOG_LEVEL("explorationLogLevel", "ALL", - "Logging level for the exploration logger: [SEVERE, WARNING, INFO, FINE, ALL]"), + "Logging level for the exploration logger: [OFF, SEVERE, WARNING, CONFIG, INFO, FINE, FINER, FINEST, ALL]"), EXPLORATION_MODE("explorationMode", "FIXED", "Exploration Mode: " + Arrays.toString(ExplorationMode.values())), DO_TAG_OUTPUT("timeTagOutput", "true", @@ -77,6 +93,8 @@ public class Configuration { "If true prune solution space before starting the exploration: [true, false]"), EXPLORATION_ALGO("explorationAlgo", "TABU_SEARCH", "Exploration algorithm: " + Arrays.toString(DefaultAlgorithms.values())), + EXPLORATION_FLAGS("explorationFlags", "", + "Additional flags to be used by specific exploration algorithms. Available options depend on the algorithm."), ACCURACY_METRIC("accuracyMetric", "PSNR_DB", "Comma-separated Accuracy metrics: " + Arrays.toString(DefaultAccuracyMetrics.values())), ACCURACY_THRESHOLD("accuracyThreshold", "40", @@ -98,8 +116,10 @@ public class Configuration { "The default integer-part-length values to use for Symbols without EXPLORE_FIX pragma: Comma-separated, Positive integer value or value range (min..max)"), DEFAULT_FLOAT_W("defaultFloatW", String.valueOf(32), "The default wordlength values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated, Positive integer value or value range (min..max)"), - DEFAULT_FLOAT_E("defaultFloatE", String.valueOf(8), + DEFAULT_FLOAT_E("defaultFloatE", String.valueOf(8), "The default exponent length values to use for Symbols without EXPLORE_FLOAT pragma: Comma-separated, Positive integer value or value range (min..max)"), + DEFAULT_SIGN("defaultSigned", String.valueOf(1), + "Set to 1 if the values are signed by default, 0 otherwise."), ; private String key; @@ -158,13 +178,41 @@ public class Configuration { private String get(Property p) { - String val = properties.getProperty(p.key); - if(val == null) { - val = p.defaultValue; - if(warnIfNotFound) - System.err.println("[WARINING] Did not find value for property: '" + p.key +"'! Continuing with default value '" + p.defaultValue + "'"); + if (!properties.containsKey(p.key)) { + properties.put(p.key, p.defaultValue); + if(warnIfNotFound) { + Logger.getLogger(LOG_MAIN).warning("[WARNING] Did not find value for property: '" + p.key +"'! Continuing with default value '" + p.defaultValue + "'"); + } } - return val; + return properties.getProperty(p.key); + } + + public String getCC() { + String cc = get(CC); + if (cc == null || cc.length() ==0) + return "g++"; + + return cc; + } + + public String getExtraCFlags() { + String cflags = get(EXTRA_CFLAGS); + if (cflags == null) + return ""; + + return cflags; + } + + public String getCostModelFilepath() { + return get(COST_MODEL_FILEPATH); + } + + public String[] getCostModelFlags() { + String cmflags = get(COST_MODEL_FLAGS); + if (cmflags == null) + return new String[] {}; + + return cmflags.split("\\s+"); } public int getNbThreads() { @@ -190,6 +238,14 @@ public class Configuration { return ExplorationMode.valueOf(get(EXPLORATION_MODE)); } + public String[] getExplorationFlags() { + String cmflags = get(EXPLORATION_FLAGS); + if (cmflags == null) + return new String[] {}; + + return cmflags.split("\\s+"); + } + public boolean isTimeTagOutputDir() { return Boolean.valueOf(get(DO_TAG_OUTPUT)); } @@ -207,7 +263,8 @@ public class Configuration { } public IExplorationAlgorithm getAlgo() { - return DefaultAlgorithms.valueOf(get(EXPLORATION_ALGO)); + String string = get(EXPLORATION_ALGO); + return DefaultAlgorithms.valueOf(string.toUpperCase()); } public Map<IAccuracyMetric, Double> getAccuracyMetrics() { @@ -249,6 +306,10 @@ public class Configuration { return valueOfCommaSeparatedInt(get(DEFAULT_FLOAT_E)); } + public int[] getDefaultSigned() { + return valueOfCommaSeparatedInt(get(DEFAULT_SIGN)); + } + public boolean isSSIMEnabled() { return Boolean.valueOf(get(SSIM_ENABLED)); } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/GlobalParameters.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/GlobalParameters.java index af6b43cc5415d807f9cc919a3b7f3f77d2f13ef8..e405a7ef2b8978ad3187ae5683f6cb7e0ba38ea3 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/GlobalParameters.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/GlobalParameters.java @@ -23,5 +23,6 @@ public class GlobalParameters { // log names static final String LOG_MAIN = "typeexplorationMain"; static final String LOG_EXPLORATION = "exploration"; + static final String LOG_EXPLORATION_STATS = "explorationStats"; } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/TypesExploration.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/TypesExploration.java index 45844b80e918436dbaac2ec5f9f9ea0f189f939e..4e111e1eda68b659096afdec2f497a2a9e4b4c17 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/TypesExploration.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/TypesExploration.java @@ -4,6 +4,7 @@ import static fr.irisa.cairn.gecos.model.factory.GecosUserAnnotationFactory.CODE import static fr.irisa.cairn.gecos.model.factory.GecosUserAnnotationFactory.pragma; import static fr.irisa.cairn.gecos.model.utils.misc.LoggingUtils.anonymousLoggerToFile; import static fr.irisa.cairn.gecos.typeexploration.GlobalParameters.LOG_EXPLORATION; +import static fr.irisa.cairn.gecos.typeexploration.GlobalParameters.LOG_EXPLORATION_STATS; import static fr.irisa.cairn.gecos.typeexploration.GlobalParameters.LOG_MAIN; import static fr.irisa.cairn.gecos.typeexploration.GlobalParameters.ROOT_OUTPUT_FOLDER; import static java.util.Arrays.asList; @@ -17,6 +18,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Function; +import java.util.logging.Level; import java.util.logging.Logger; import org.jfree.data.statistics.HistogramType; @@ -25,11 +27,13 @@ import com.google.common.base.Stopwatch; import com.google.common.base.Throwables; import com.google.common.primitives.Ints; +import fr.irisa.cairn.gecos.core.profiling.backend.NativeProfilingEngineSupport; import fr.irisa.cairn.gecos.core.profiling.backend.ProfilingInfo; import fr.irisa.cairn.gecos.model.analysis.types.TypeAnalyzer; import fr.irisa.cairn.gecos.model.c.generator.XtendCGenerator; import fr.irisa.cairn.gecos.model.cdtfrontend.CDTFrontEnd; import fr.irisa.cairn.gecos.model.utils.misc.LoggingUtils; +import fr.irisa.cairn.gecos.model.utils.misc.LoggingUtils.PlainFormatter; import fr.irisa.cairn.gecos.model.utils.misc.PathUtils; import fr.irisa.cairn.gecos.model.utils.misc.ThreadUtils; import fr.irisa.cairn.gecos.typeexploration.accuracy.AcFixedCtFloatGenerator; @@ -57,7 +61,6 @@ import gecos.core.Symbol; import gecos.gecosproject.GecosProject; import typeexploration.SolutionSpace; import typeexploration.TypeConfiguration; -import typeexploration.computation.ComputationModel; /** @@ -66,16 +69,21 @@ import typeexploration.computation.ComputationModel; @GSModule("This module provides a framework for exploring custom fixed-point and/or floating-point types.") public class TypesExploration { - protected GecosProject project; - protected Configuration configuration; - protected ComputationModel computationModel; + protected final GecosProject project; + protected final Configuration configuration; protected GecosProject originalProjectCopy; - + + /** + * @deprecated: should be moved to UI handler or wizard + */ + @Deprecated @GSModuleConstructor(value = "Generate the default configuration file and exit", args = { @GSArg(name = "defaultConfigurationLocation", info = "Directory where the default configuration file will be generated at")}) - public TypesExploration(String defaultConfigurationLocation) { + public TypesExploration(final String defaultConfigurationLocation) { + project = null; + configuration = null; try { Configuration.generateDefaultConfigurationFile(Paths.get(defaultConfigurationLocation)); System.exit(0); @@ -83,22 +91,20 @@ public class TypesExploration { e.printStackTrace(); } } + + + @GSModuleConstructor(value = "Run the type exploration flow using the default configuration.", args = { + @GSArg(name = "project", info = "The gecos project containing the sources on which the exploration will be performed. Can be unparsed.")}) + public TypesExploration(final GecosProject unparsedProject) { + this(unparsedProject, null); + } @GSModuleConstructor(value = "Run the type exploration flow using the specified configuration.", args = { @GSArg(name = "project", info = "The gecos project containing the sources on which the exploration will be performed. Can be unparsed."), @GSArg(name = "configurationFile", info = "The configuration file to be used. (A default config file can be generated, see other constructors)")}) - public TypesExploration(GecosProject unparsedProject, String configurationFile) { + public TypesExploration(final GecosProject unparsedProject, final String configurationFile) { Objects.requireNonNull(unparsedProject); - - loadConfig(configurationFile); - - this.project = unparsedProject; - if(!project.isParsed()) - parseProject(); - this.originalProjectCopy = project.copy(); - } - - private void loadConfig(String configurationFile) { + if(configurationFile == null) { this.configuration = new Configuration(); } else { @@ -108,26 +114,6 @@ public class TypesExploration { throw new RuntimeException("Failed to load configuration file: " + configurationFile, e); } } - } - - @GSModuleConstructor(value = "Run the type exploration flow using the specified configuration.", args = { - @GSArg(name = "project", info = "The gecos project containing the sources on which the exploration will be performed. Can be unparsed."), - @GSArg(name = "configurationFile", info = "The configuration file to be used. (A default config file can be generated, see other constructors)"), - @GSArg(name = "computationModelFile", info = "The computation model file to be used.")}) - public TypesExploration(GecosProject unparsedProject, String configurationFile, String computationModelFile) { - Objects.requireNonNull(unparsedProject); - - loadConfig(configurationFile); - - if (computationModelFile == null) { - this.computationModel = null; - } else { - try { - this.computationModel = ComputationModelIO.loadModel(computationModelFile); - } catch (IOException e) { - throw new RuntimeException("Failed to load computation model file: " + computationModelFile, e); - } - } this.project = unparsedProject; if(!project.isParsed()) @@ -135,13 +121,6 @@ public class TypesExploration { this.originalProjectCopy = project.copy(); } - @GSModuleConstructor(value = "Run the type exploration flow using the default configuration.", args = { - @GSArg(name = "project", info = "The gecos project containing the sources on which the exploration will be performed. Can be unparsed.")}) - public TypesExploration(GecosProject unparsedProject) { - this(unparsedProject, null); - } - - protected void parseProject() { CDTFrontEnd parser = new CDTFrontEnd(project); CDTFrontEnd.annotateFileLocations(true); //XXX this should not be static! @@ -184,7 +163,7 @@ public class TypesExploration { logger.info(" - Start types exploration"); Stopwatch w = Stopwatch.createStarted(); try { - ISolution solution = Components.getInstance().getExplorationAlgorithm().explore(solutionSpace); + ISolution solution = Components.getInstance().getExplorationAlgorithm().explore(solutionSpace, configuration.getExplorationFlags()); logger.info(" - Exploration finished in " + w); generateSolutionCode(logger, solution); @@ -208,8 +187,8 @@ public class TypesExploration { protected Components createComponents() { List<TypeConfiguration> defaultTypeConfigs = asList( - UserFactory.fixedConfiguration(Ints.asList(configuration.getDefaultFixedW()), Ints.asList(configuration.getDefaultFixedI())), - UserFactory.floatConfiguration(Ints.asList(configuration.getDefaultFloatW()), Ints.asList(configuration.getDefaultFloatE()))); + UserFactory.defaultFixedConfiguration(Ints.asList(configuration.getDefaultFixedW()), Ints.asList(configuration.getDefaultFixedI()), Ints.asList(configuration.getDefaultSigned())), + UserFactory.defaultFloatConfiguration(Ints.asList(configuration.getDefaultFloatW()), Ints.asList(configuration.getDefaultFloatE()), Ints.asList(configuration.getDefaultSigned()))); //!! more complex constraints can be used as composition of other constraints // You only need to provide a convenient way for the user to specify them.. @@ -222,18 +201,27 @@ public class TypesExploration { Components comp = new Components(); comp.configuration = configuration; - comp.computationModel = computationModel; - + if (configuration.getCostModelFilepath() == null || configuration.getCostModelFilepath().length() == 0) { + comp.computationModel = null; + } else { + try { + comp.computationModel = ComputationModelIO.loadModel(configuration.getCostModelFilepath()); + } catch (IOException e) { + throw new RuntimeException("Failed to load computation model file: " + configuration.getCostModelFilepath(), e); + } + } comp.outputLoc = new OutputLocations(ROOT_OUTPUT_FOLDER.resolve(project.getName()), configuration.isTimeTagOutputDir(), configuration.getNbTaggedOutputsTokeep()); - comp.mainLogger = LoggingUtils.useStdout(Logger.getLogger(LOG_MAIN)); - comp.mainLogger.setLevel(configuration.getMainLoggerLevel()); + Logger logger = Logger.getLogger(LOG_MAIN); + comp.mainLogger = LoggingUtils.useStdout(logger, configuration.getMainLoggerLevel()); - comp.expLogger = LoggingUtils.loggerToFile(Logger.getLogger(LOG_EXPLORATION), + comp.expLogger = LoggingUtils.loggerToFile(Logger.getLogger(LOG_EXPLORATION), configuration.getExploarationLoggerLevel(), comp.outputLoc.getLogsDir().resolve(LOG_EXPLORATION+".log"), true); - comp.expLogger.setLevel(configuration.getExploarationLoggerLevel()); + + comp.expStatsLogger = LoggingUtils.loggerToFile(Logger.getLogger(LOG_EXPLORATION_STATS), Level.ALL, + comp.outputLoc.getLogsDir().resolve(LOG_EXPLORATION_STATS+".log"), false, new PlainFormatter()); comp.solutionSpaceBuilder = new SolutionSpaceBuilderFromPragma(defaultTypeConfigs); @@ -248,8 +236,8 @@ public class TypesExploration { comp.explorationAlgorithm = configuration.getAlgo(); - if (computationModel != null) { - comp.costEvaluator = new ComputationModelEvaluator(computationModel); + if (comp.computationModel != null) { + comp.costEvaluator = new ComputationModelEvaluator(comp.computationModel, configuration.getCostModelFlags()); } else { comp.costEvaluator = new DummyCostEvaluator(); } @@ -262,6 +250,11 @@ public class TypesExploration { comp.accuracyEvaluator = new SimulationAccuracyEvaluator(project); + + //Reflect compiler options to profiling engine + NativeProfilingEngineSupport.CC = comp.configuration.getCC(); + NativeProfilingEngineSupport.EXTRA_CFLAGS = comp.configuration.getExtraCFlags(); + return comp; } @@ -345,6 +338,7 @@ public class TypesExploration { private void waitInput(String msg) { try { System.out.println(msg); + System.out.flush(); System.in.read(); } catch (IOException e) { e.printStackTrace(); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/accuracy/DefaultAccuracyMetrics.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/accuracy/DefaultAccuracyMetrics.java index 4386a4e7dc6cfacb25aab3264b976c41310566fe..2e08c271ff1e0669f10c634200d26521e97b2e8e 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/accuracy/DefaultAccuracyMetrics.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/accuracy/DefaultAccuracyMetrics.java @@ -8,21 +8,21 @@ import fr.irisa.cairn.gecos.typeexploration.model.ISolution; public enum DefaultAccuracyMetrics { // Error signal stats - MAX_ABS_ERR("Maximum Absolute Error", false, s -> s.getAccuracy(SimulationAccuracyEvaluator.METRIC_NAME_MAX_ABS_ERR)), - PSNR("Peak Signal to Noise Ratio", true, s -> s.getAccuracy(SimulationAccuracyEvaluator.METRIC_NAME_PSNR)), - PSNR_DB("Peak Signal to Noise Ratio in dB", true, s -> s.getAccuracy(SimulationAccuracyEvaluator.METRIC_NAME_PSNR_DB)), - POWER("Noise Power", false, s -> s.getAccuracy(SimulationAccuracyEvaluator.METRIC_NAME_POWER)), - POWER_DB("Noise Power in dB", false, s -> s.getAccuracy(SimulationAccuracyEvaluator.METRIC_NAME_POWER_DB)), + MAX_ABS_ERR("Maximum Absolute Error", false, s -> s.getAccuracy(SimulationAccuracyEvaluator.METRIC_NAME_MAX_ABS_ERR), 1), + PSNR("Peak Signal to Noise Ratio", true, s -> s.getAccuracy(SimulationAccuracyEvaluator.METRIC_NAME_PSNR), 1), + PSNR_DB("Peak Signal to Noise Ratio in dB", true, s -> s.getAccuracy(SimulationAccuracyEvaluator.METRIC_NAME_PSNR_DB), 1), + POWER("Noise Power", false, s -> s.getAccuracy(SimulationAccuracyEvaluator.METRIC_NAME_POWER), 1), + POWER_DB("Noise Power in dB", false, s -> s.getAccuracy(SimulationAccuracyEvaluator.METRIC_NAME_POWER_DB), 1), //TODO many other metrics are available, just expose them here if needed.. // Image quality metrics - SSIM("Structural Similarity (SSIM)", true, s -> s.getAccuracy(SimulationAccuracyEvaluator.METRIC_NAME_SSIM)), + SSIM("Structural Similarity (SSIM)", true, s -> s.getAccuracy(SimulationAccuracyEvaluator.METRIC_NAME_SSIM), 0.1), ; private IAccuracyMetric metric; - private DefaultAccuracyMetrics(String description, boolean higherIsBetter, Function<ISolution, Double> accuracyMetric) { - metric = IAccuracyMetric.createMetric(description, higherIsBetter, accuracyMetric); + private DefaultAccuracyMetrics(String description, boolean higherIsBetter, Function<ISolution, Double> accuracyMetric, double normalizationRangeLB) { + metric = IAccuracyMetric.createMetric(description, higherIsBetter, accuracyMetric, normalizationRangeLB); } public IAccuracyMetric getMetric() { diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/accuracy/InternalProfiler.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/accuracy/InternalProfiler.java new file mode 100644 index 0000000000000000000000000000000000000000..4693db05936427ce43858838a8380b53a720484f --- /dev/null +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/accuracy/InternalProfiler.java @@ -0,0 +1,215 @@ +package fr.irisa.cairn.gecos.typeexploration.accuracy; + +import static fr.irisa.cairn.gecos.model.factory.GecosUserAnnotationFactory.CODEGEN_IGNORE_ANNOTATION; +import static fr.irisa.cairn.gecos.model.factory.GecosUserAnnotationFactory.pragma; +import static fr.irisa.cairn.gecos.model.factory.GecosUserTypeFactory.ALIAS; +import static fr.irisa.cairn.gecos.model.factory.GecosUserTypeFactory.VOID; +import static java.util.stream.Collectors.toMap; + +import java.nio.file.Path; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import fr.irisa.cairn.gecos.core.profiling.SimulationBasedProfiler; +import fr.irisa.cairn.gecos.core.profiling.backend.ProfilingBackendFailure; +import fr.irisa.cairn.gecos.core.profiling.backend.ProfilingInfo; +import fr.irisa.cairn.gecos.model.analysis.types.TypeAnalyzer; +import fr.irisa.cairn.gecos.model.c.generator.XtendCGenerator; +import fr.irisa.cairn.gecos.model.factory.GecosUserTypeFactory; +import fr.irisa.cairn.gecos.model.utils.misc.PathUtils; +import fr.irisa.cairn.gecos.typeexploration.Components; +import fr.irisa.cairn.gecos.typeexploration.dse.ExplorationMode; +import fr.irisa.cairn.gecos.typeexploration.model.ISolution; +import fr.irisa.cairn.gecos.typeexploration.model.UserFactory; +import gecos.core.Symbol; +import gecos.gecosproject.GecosProject; +import gecos.types.StorageClassSpecifiers; +import gecos.types.Type; +import typeexploration.SolutionSpace; + +class InternalProfiler { + + /** + * + */ + private final SimulationAccuracyEvaluator simulationAccuracyEvaluator; + ISolution referenceSolution; + SimulationBasedProfiler prof; + private ITypeParamGenerator generator; + private Map<Symbol, String> symbolGenericTypeNameMap; + + + public InternalProfiler(SimulationAccuracyEvaluator simulationAccuracyEvaluator) { + this.simulationAccuracyEvaluator = simulationAccuracyEvaluator; + this.prof = new SimulationBasedProfiler(this.simulationAccuracyEvaluator.project, false, false, this.simulationAccuracyEvaluator.logger); + this.generator = Objects.requireNonNull(Components.getInstance().getTypesGenerator(), "No Types generator component was registerd!"); + + /** + * Replace solution space symbols base types with Macros. + */ + SolutionSpace solutionSpace = Components.getInstance().getSolutionSpaceBuilder().getSolutionSpace(); + replaceSymbolTypesWithMacros(solutionSpace); + + /** Insert instrumentation code **/ + this.simulationAccuracyEvaluator.logger.info(" - Transforming code: add instrumentation"); + GecosProject projectCopyWithNoDirectives = prof.insertProfiling(Components.getInstance().getConfiguration().getNbSimulations()); + + /** generate generic instrumented code **/ + Path originalNoDirectivesOutputDir = PathUtils.createDir(this.simulationAccuracyEvaluator.rootOutDir, "code-no-instrumentation", true); + this.simulationAccuracyEvaluator.logger.info(" - Generating original code without directives in: " + originalNoDirectivesOutputDir); + new XtendCGenerator(projectCopyWithNoDirectives, originalNoDirectivesOutputDir.toString()).compute(); + + Path refImplOutputDir = PathUtils.createDir(this.simulationAccuracyEvaluator.rootOutDir, "code-instrumented", true); + this.simulationAccuracyEvaluator.logger.info(" - Generating Instrumented code in: " + refImplOutputDir); + prof.generateProfiledCode(refImplOutputDir); + } + + + private void replaceSymbolTypesWithMacros(SolutionSpace solutionSpace) { + this.symbolGenericTypeNameMap = new HashMap<>(); + this.referenceSolution = UserFactory.solution(solutionSpace); + + /** replace type of s by a alias */ + solutionSpace.getSymbols().forEach(s->generalizeType(solutionSpace, s)); + + /** + * if multiple symbol have same generic type name, this mean that multiple symbols + * use the same typedef. + * This is currently not supported! + */ + Map<String, Symbol> genericTypeNameToSymbol = new HashMap<>(); + for(Symbol symb : symbolGenericTypeNameMap.keySet()) { + String name = symbolGenericTypeNameMap.get(symb); + if(genericTypeNameToSymbol.containsKey(name)) { + //TODO This can be solved by adding a SAME constraint between both symbols + // but this should better be done before starting explorations! + throw new RuntimeException("Not yet supported: Multiple symbols cannot use the same type defined with a 'typedef'! " + + symb + " and " + genericTypeNameToSymbol.get(name)); + } else + genericTypeNameToSymbol.put(name, symb); + } + } + + private void generalizeType(SolutionSpace sol, Symbol s) { + GecosUserTypeFactory.setScope(s.getContainingScope().getRoot()); + TypeAnalyzer ta = new TypeAnalyzer(s.getType()); + + String genericTypeName; + if(ta.getBaseLevel().getAlias() != null) { + // TODO: + // if symbol base type is already an alias => keep using it as the generic type but only change its definition + // This will enable a generic use of this type in the code (like casting, sizeof ...) + // without it becoming hard coded causing compilation errors + + genericTypeName = ta.getBaseLevel().getAlias().getName(); + setGenericTypeName(s, genericTypeName); + + //XXX + // this is a hack that only works if typedef is defined in the scope of s. + // It is needed currently because the (alias) types are copied for each typedElement + // (i.e. they do not refer to the same type, so changing the type does not affect others ..) + Type lookupAliasType = s.getContainingScope().lookupAliasType(genericTypeName); + if(lookupAliasType != null) + pragma(lookupAliasType, CODEGEN_IGNORE_ANNOTATION); + } else { + /* create a macro generic Type */ + genericTypeName = getGenericTypeName(sol, s); + } + + Type generic = ALIAS(VOID(), genericTypeName); + pragma(generic, CODEGEN_IGNORE_ANNOTATION); + + + /* replace Symbol's type with the generic one */ + s.setType(ta.revertAllLevelsOn(generic)); + + /* save original (reference) type definition */ + Type refTypeBase = ta.getBase().copy(); + // Qualifiers are kept with the generic type so we remove all of them + refTypeBase.setConstant(false); + refTypeBase.setStorageClass(StorageClassSpecifiers.NONE); + refTypeBase.setVolatile(false); + + referenceSolution.setType(s, UserFactory.genericTypeParam(refTypeBase)); + } + + int uid = 0; + private String getGenericTypeName(SolutionSpace sol, Symbol s) { + String name = symbolGenericTypeNameMap.get(s); + if(name == null) { + name = sol.getUniqueTypeName(s); + setGenericTypeName(s, name); + } + return name; + } + + private void setGenericTypeName(Symbol s, String name) { + symbolGenericTypeNameMap.put(s, name); + } + + Map<Symbol, ProfilingInfo<? extends Number>> runSimulationAndProfile(ISolution solution, String solIDName, int nbSimus, int initSeedValue) + throws ProfilingBackendFailure { + Path outDir; + synchronized (this) { + outDir = PathUtils.createDir(this.simulationAccuracyEvaluator.simulationsDir, solIDName, true); + } + + Map<String, String> typeDefMacros = solution.getSymbols().stream() + .collect(toMap( s -> getGenericTypeName(solution.getSolutionSpace(), s), + s -> generator.generate(solution.getType(s)))); + + if(solIDName.equals(SimulationAccuracyEvaluator.REF_IMPLEM_NAME)) + typeDefMacros.put(SimulationAccuracyEvaluator.GECOS_REF_IMPL_MACRO, "1"); + + ExplorationMode expMode = Components.getInstance().getExplorationMode(); + boolean useFixed = true; + boolean useFloat = true; + if(expMode == ExplorationMode.FIXED) useFloat = false; + if(expMode == ExplorationMode.FLOAT) useFixed = false; + + Map<Symbol, ProfilingInfo<? extends Number>> profiledSymbols = prof.profile(outDir, + generator.getIncDirs(useFixed, useFloat), + generator.getLibDirs(useFixed, useFloat), + generator.getLibs(useFixed, useFloat), + generator.getHeaders(useFixed, useFloat), + typeDefMacros, nbSimus, initSeedValue); + + return profiledSymbols; + } + + +// /** +// * Cast operands of ?: to the destination's type in case it is a SetInstruction +// * Otherwise we may get an error if each operand has a different type) +// */ +// private void castOperandsofMux(Symbol s) { +// //FIXME if symbol is use outside ps => need to propagate in those procedure sets as well +// ProcedureSet ps = EcoreUtil2.getContainerOfType(s, ProcedureSet.class); +// Objects.requireNonNull(ps, "Symbol is not contained in a procedureSet: " + s); +// +// Set<GenericInstruction> muxes = Streams.stream(ps.eAllContents()) +// .filter(SymbolInstruction.class::isInstance) +// .map(SymbolInstruction.class::cast) +// .filter(symref -> symref.getSymbol() == s) // symref refers to s +// .map(symref -> EObjectUtils.getContainerOfType(symref, GenericInstruction.class, symref.getRoot(), +// g -> g.getName().equals(SelectOperator.MUX.getLiteral()))) +// .filter(Objects::nonNull) +// .collect(toSet()); +// +// muxes.forEach(mux -> { +// Type type = null; +// if(mux.getRoot() instanceof SetInstruction) +// type = ((SetInstruction) mux.getRoot()).getDest().getType(); +// +// if(type != null) { +// System.out.println("$$$$ " + s); +// muxes.forEach(i -> System.out.println(i.getRoot() + " at line " + i.getRoot().getFileLocation())); +// +// EcoreUtil.replace(mux.getOperand(1), cast(type, mux.getOperand(1).copy())); +// EcoreUtil.replace(mux.getOperand(2), cast(type, mux.getOperand(2).copy())); +// } +// }); +// } + + } \ No newline at end of file diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/accuracy/SimulationAccuracyEvaluator.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/accuracy/SimulationAccuracyEvaluator.java index da5a5b84c14079a53a0fff8d826ea3c4514687b0..296fb79ba983526ee04c519a9b683f58b360f9c9 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/accuracy/SimulationAccuracyEvaluator.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/accuracy/SimulationAccuracyEvaluator.java @@ -1,14 +1,8 @@ package fr.irisa.cairn.gecos.typeexploration.accuracy; -import static fr.irisa.cairn.gecos.model.factory.GecosUserAnnotationFactory.CODEGEN_IGNORE_ANNOTATION; -import static fr.irisa.cairn.gecos.model.factory.GecosUserAnnotationFactory.pragma; -import static fr.irisa.cairn.gecos.model.factory.GecosUserTypeFactory.ALIAS; -import static fr.irisa.cairn.gecos.model.factory.GecosUserTypeFactory.VOID; import static java.util.stream.Collectors.toList; -import static java.util.stream.Collectors.toMap; import java.nio.file.Path; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -19,30 +13,21 @@ import java.util.stream.IntStream; import org.jfree.data.statistics.HistogramType; -import fr.irisa.cairn.gecos.core.profiling.SimulationBasedProfiler; import fr.irisa.cairn.gecos.core.profiling.backend.ErrorStats; import fr.irisa.cairn.gecos.core.profiling.backend.ProfilingBackendFailure; import fr.irisa.cairn.gecos.core.profiling.backend.ProfilingInfo; -import fr.irisa.cairn.gecos.model.analysis.types.TypeAnalyzer; -import fr.irisa.cairn.gecos.model.c.generator.XtendCGenerator; -import fr.irisa.cairn.gecos.model.factory.GecosUserTypeFactory; import fr.irisa.cairn.gecos.model.utils.misc.PathUtils; import fr.irisa.cairn.gecos.typeexploration.Components; import fr.irisa.cairn.gecos.typeexploration.Configuration; import fr.irisa.cairn.gecos.typeexploration.TypesExploration; -import fr.irisa.cairn.gecos.typeexploration.dse.ExplorationMode; import fr.irisa.cairn.gecos.typeexploration.model.IAccuracyEvaluator; import fr.irisa.cairn.gecos.typeexploration.model.ISolution; -import fr.irisa.cairn.gecos.typeexploration.model.UserFactory; import fr.irisa.cairn.gecos.typeexploration.utils.BitHistogramChart; import fr.irisa.cairn.gecos.typeexploration.utils.HistogramChart; import fr.irisa.cairn.gecos.typeexploration.utils.ImageViewer; import fr.irisa.cairn.gecos.typeexploration.utils.SolutionSpaceUtils; import gecos.core.Symbol; import gecos.gecosproject.GecosProject; -import gecos.types.StorageClassSpecifiers; -import gecos.types.Type; -import typeexploration.SolutionSpace; /** * @author aelmouss @@ -61,16 +46,16 @@ public class SimulationAccuracyEvaluator implements IAccuracyEvaluator { public static final String METRIC_NAME_SSIM = "SSIM"; - private static final String REF_IMPLEM_NAME = "ref"; + static final String REF_IMPLEM_NAME = "ref"; - private Logger logger; + Logger logger; - private Path rootOutDir; - private Path simulationsDir; - private GecosProject project; + Path rootOutDir; + Path simulationsDir; + GecosProject project; private Configuration config; - private Profiler profiler; + private InternalProfiler profiler; private IAccuracyMetricCalculator accuracyMetricCalculator; private Map<Symbol, ProfilingInfo<? extends Number>> referenceProfilingData; @@ -102,11 +87,11 @@ public class SimulationAccuracyEvaluator implements IAccuracyEvaluator { this.config = comp.getConfiguration(); this.simulationsDir = PathUtils.createDir(rootOutDir, "simulations", true); - this.profiler = new Profiler(); + this.profiler = new InternalProfiler(this); /* profile the reference implementation */ try { - this.referenceProfilingData = profiler.runSimulationAndProfile(profiler.referenceSolution, REF_IMPLEM_NAME); + this.referenceProfilingData = profiler.runSimulationAndProfile(profiler.referenceSolution, REF_IMPLEM_NAME, this.config.getNbSimulations(), -1); } catch (ProfilingBackendFailure e) { throw new AccuracyEvaluationException("Error occured while simulating reference solution", e); } @@ -142,7 +127,7 @@ public class SimulationAccuracyEvaluator implements IAccuracyEvaluator { Map<Symbol, ProfilingInfo<? extends Number>> symbolValues = null; try { - symbolValues = profiler.runSimulationAndProfile(solution, "sol" + solution.getID()); + symbolValues = profiler.runSimulationAndProfile(solution, "sol" + solution.getID(), this.config.getNbSimulations(), -1); } catch(Exception e) { throw new AccuracyEvaluationException("Error occured while simulating solution " + solution.getID(), e); } @@ -151,6 +136,8 @@ public class SimulationAccuracyEvaluator implements IAccuracyEvaluator { Map<Symbol, List<ErrorStats>> snapshotErrorStatsMap = computeError(solution, symbolValues); ErrorStats errorStats = accuracyMetricCalculator.compute(snapshotErrorStatsMap); solution.addAccuracy(METRIC_NAME_MAX_ABS_ERR, errorStats.getAbsoluteMax()); + // TODO: when Gecos profiling code is released, use following: + // solution.addAccuracy(METRIC_NAME_MAX_ABS_ERR, errorStats.getDynamicRange()); solution.addAccuracy(METRIC_NAME_PSNR , errorStats.getPSNR()); solution.addAccuracy(METRIC_NAME_PSNR_DB , errorStats.getPSNRdB()); solution.addAccuracy(METRIC_NAME_POWER , errorStats.getPower()); @@ -236,7 +223,7 @@ public class SimulationAccuracyEvaluator implements IAccuracyEvaluator { if(refSnap.length != curSnap.length) throw new RuntimeException("Number of values in snapshot " + i + " differ between current and " + "reference implemetation: " +refSnap.length + " vs " + curSnap.length); - return ErrorStats.ofDiff(curSnap, refSnap); + return ErrorStats.ofDiff(refSnap, curSnap); }).collect(toList()); snapshotErrorStatsMap.put(sym, snapshotErrorStats); @@ -248,185 +235,4 @@ public class SimulationAccuracyEvaluator implements IAccuracyEvaluator { return snapshotErrorStatsMap; } - private class Profiler { - - private ISolution referenceSolution; - private SimulationBasedProfiler prof; - private ITypeParamGenerator generator; - private Map<Symbol, String> symbolGenericTypeNameMap; - - - public Profiler() { - this.prof = new SimulationBasedProfiler(project, false, logger); - this.generator = Objects.requireNonNull(Components.getInstance().getTypesGenerator(), "No Types generator component was registerd!"); - - /** - * Replace solution space symbols base types with Macros. - */ - SolutionSpace solutionSpace = Components.getInstance().getSolutionSpaceBuilder().getSolutionSpace(); - replaceSymbolTypesWithMacros(solutionSpace); - - /** Insert instrumentation code **/ - logger.info(" - Transforming code: add instrumentation"); - GecosProject projectCopyWithNoDirectives = prof.insertProfiling(Components.getInstance().getConfiguration().getNbSimulations()); - - /** generate generic instrumented code **/ - Path originalNoDirectivesOutputDir = PathUtils.createDir(rootOutDir, "code-no-instrumentation", true); - logger.info(" - Generating original code without directives in: " + originalNoDirectivesOutputDir); - new XtendCGenerator(projectCopyWithNoDirectives, originalNoDirectivesOutputDir.toString()).compute(); - - Path refImplOutputDir = PathUtils.createDir(rootOutDir, "code-instrumented", true); - logger.info(" - Generating Instrumented code in: " + refImplOutputDir); - prof.generateProfiledCode(refImplOutputDir); - } - - - private void replaceSymbolTypesWithMacros(SolutionSpace solutionSpace) { - this.symbolGenericTypeNameMap = new HashMap<>(); - this.referenceSolution = UserFactory.solution(solutionSpace); - - /** replace type of s by a alias */ - solutionSpace.getSymbols().forEach(this::generalizeType); - - /** - * if multiple symbol have same generic type name, this mean that multiple symbols - * use the same typedef. - * This is currently not supported! - */ - Map<String, Symbol> genericTypeNameToSymbol = new HashMap<>(); - for(Symbol symb : symbolGenericTypeNameMap.keySet()) { - String name = symbolGenericTypeNameMap.get(symb); - if(genericTypeNameToSymbol.containsKey(name)) { - //TODO This can be solved by adding a SAME constraint between both symbols - // but this should better be done before starting explorations! - throw new RuntimeException("Not yet supported: Multiple symbols cannot use the same type defined with a 'typedef'! " - + symb + " and " + genericTypeNameToSymbol.get(name)); - } else - genericTypeNameToSymbol.put(name, symb); - } - } - - private void generalizeType(Symbol s) { - GecosUserTypeFactory.setScope(s.getContainingScope().getRoot()); - TypeAnalyzer ta = new TypeAnalyzer(s.getType()); - - String genericTypeName; - if(ta.getBaseLevel().getAlias() != null) { - // TODO: - // if symbol base type is already an alias => keep using it as the generic type but only change its definition - // This will enable a generic use of this type in the code (like casting, sizeof ...) - // without it becoming hard coded causing compilation errors - - genericTypeName = ta.getBaseLevel().getAlias().getName(); - setGenericTypeName(s, genericTypeName); - - //XXX - // this is a hack that only works if typedef is defined in the scope of s. - // It is needed currently because the (alias) types are copied for each typedElement - // (i.e. they do not refer to the same type, so changing the type does not affect others ..) - Type lookupAliasType = s.getContainingScope().lookupAliasType(genericTypeName); - if(lookupAliasType != null) - pragma(lookupAliasType, CODEGEN_IGNORE_ANNOTATION); - } else { - /* create a macro generic Type */ - genericTypeName = getGenericTypeName(s); - } - - Type generic = ALIAS(VOID(), genericTypeName); - pragma(generic, CODEGEN_IGNORE_ANNOTATION); - - - /* replace Symbol's type with the generic one */ - s.setType(ta.revertAllLevelsOn(generic)); - - /* save original (reference) type definition */ - Type refTypeBase = ta.getBase().copy(); - // Qualifiers are kept with the generic type so we remove all of them - refTypeBase.setConstant(false); - refTypeBase.setStorageClass(StorageClassSpecifiers.NONE); - refTypeBase.setVolatile(false); - - referenceSolution.setType(s, UserFactory.genericTypeParam(refTypeBase)); - } - - int uid = 0; - private String getGenericTypeName(Symbol s) { - String name = symbolGenericTypeNameMap.get(s); - if(name == null) { - name = "TYPE_" + s.getName() + "_" + (uid++); - setGenericTypeName(s, name); - } - return name; - } - - private void setGenericTypeName(Symbol s, String name) { - symbolGenericTypeNameMap.put(s, name); - } - - private Map<Symbol, ProfilingInfo<? extends Number>> runSimulationAndProfile(ISolution solution, String solIDName) - throws ProfilingBackendFailure { - Path outDir; - synchronized (this) { - outDir = PathUtils.createDir(simulationsDir, solIDName, true); - } - - Map<String, String> typeDefMacros = solution.getSymbols().stream() - .collect(toMap( s -> getGenericTypeName(s), - s -> generator.generate(solution.getType(s)))); - - if(solIDName.equals(REF_IMPLEM_NAME)) - typeDefMacros.put(GECOS_REF_IMPL_MACRO, "1"); - - ExplorationMode expMode = Components.getInstance().getExplorationMode(); - boolean useFixed = true; - boolean useFloat = true; - if(expMode == ExplorationMode.FIXED) useFloat = false; - if(expMode == ExplorationMode.FLOAT) useFixed = false; - - Map<Symbol, ProfilingInfo<? extends Number>> profiledSymbols = prof.profile(outDir, - generator.getIncDirs(useFixed, useFloat), - generator.getLibDirs(useFixed, useFloat), - generator.getLibs(useFixed, useFloat), - generator.getHeaders(useFixed, useFloat), - typeDefMacros); - - return profiledSymbols; - } - - -// /** -// * Cast operands of ?: to the destination's type in case it is a SetInstruction -// * Otherwise we may get an error if each operand has a different type) -// */ -// private void castOperandsofMux(Symbol s) { -// //FIXME if symbol is use outside ps => need to propagate in those procedure sets as well -// ProcedureSet ps = EcoreUtil2.getContainerOfType(s, ProcedureSet.class); -// Objects.requireNonNull(ps, "Symbol is not contained in a procedureSet: " + s); -// -// Set<GenericInstruction> muxes = Streams.stream(ps.eAllContents()) -// .filter(SymbolInstruction.class::isInstance) -// .map(SymbolInstruction.class::cast) -// .filter(symref -> symref.getSymbol() == s) // symref refers to s -// .map(symref -> EObjectUtils.getContainerOfType(symref, GenericInstruction.class, symref.getRoot(), -// g -> g.getName().equals(SelectOperator.MUX.getLiteral()))) -// .filter(Objects::nonNull) -// .collect(toSet()); -// -// muxes.forEach(mux -> { -// Type type = null; -// if(mux.getRoot() instanceof SetInstruction) -// type = ((SetInstruction) mux.getRoot()).getDest().getType(); -// -// if(type != null) { -// System.out.println("$$$$ " + s); -// muxes.forEach(i -> System.out.println(i.getRoot() + " at line " + i.getRoot().getFileLocation())); -// -// EcoreUtil.replace(mux.getOperand(1), cast(type, mux.getOperand(1).copy())); -// EcoreUtil.replace(mux.getOperand(2), cast(type, mux.getOperand(2).copy())); -// } -// }); -// } - - } - } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/cost/ComputationModelEvaluator.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/cost/ComputationModelEvaluator.java index 1203d4fd9e0f4659193ab17338d1c69a524dba17..cf1b5775104a11bb3f227fe8da3b122405064414 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/cost/ComputationModelEvaluator.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/cost/ComputationModelEvaluator.java @@ -1,11 +1,13 @@ package fr.irisa.cairn.gecos.typeexploration.cost; +import java.util.List; import java.util.Optional; import fr.irisa.cairn.gecos.typeexploration.model.ICostEvaluator; import fr.irisa.cairn.gecos.typeexploration.model.ISolution; import gecos.core.Symbol; import typeexploration.computation.AddExpression; +import typeexploration.computation.BlockGroup; import typeexploration.computation.ComputationBlock; import typeexploration.computation.ComputationModel; import typeexploration.computation.MaxExpression; @@ -32,6 +34,7 @@ public class ComputationModelEvaluator implements ICostEvaluator { protected final ComputationModel computationModel; protected static final ConcreteComputationModelEvaluator concreteModelEvaluator; + protected BlockGroup targetBlockGroup; //FIXME private static final HWModelParameters data ; @@ -48,8 +51,26 @@ public class ComputationModelEvaluator implements ICostEvaluator { //FIXME temporarily solution for allowing SUM_W metric all the time private final DummyCostEvaluator dummyEvaluator = new DummyCostEvaluator(); - public ComputationModelEvaluator(ComputationModel computationModel) { + public ComputationModelEvaluator(ComputationModel computationModel, String[] options) { this.computationModel = computationModel; + parseOptions(options); + } + + private void parseOptions(String[] options) { + for (String option : options) { + String[] split = option.split("="); + if (split.length != 2) continue; + parseOption(split[0], split[1]); + } + } + + private void parseOption(String name, String value) { + if (name.contentEquals("group")) { + Optional<BlockGroup> group = computationModel.getBlockGroups().stream().filter(bg->bg.getName().contentEquals(value)).findFirst(); + if (group.isPresent()) { + targetBlockGroup = group.get(); + } + } } @Override @@ -57,7 +78,9 @@ public class ComputationModelEvaluator implements ICostEvaluator { double areaTotal = 0; double energyTotal = 0; - for (ComputationBlock block : computationModel.getBlocks()) { + + List<ComputationBlock> blocks = targetBlockGroup==null?computationModel.getBlocks():targetBlockGroup.getBlocks(); + for (ComputationBlock block : blocks) { evaluateBlock(solution, block); areaTotal += solution.getCost(AREA_MODEL, block.getName()); energyTotal += solution.getCost(ENERGY_MODEL, block.getName()); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/cost/DefaultCostMetrics.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/cost/DefaultCostMetrics.java index a462bcfc1c65ea4d787a79e30edcfd2a0289989a..1c8bab6baccd2b3ff00c77d6d77575e50c22f34d 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/cost/DefaultCostMetrics.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/cost/DefaultCostMetrics.java @@ -8,15 +8,15 @@ import fr.irisa.cairn.gecos.typeexploration.model.ISolution; public enum DefaultCostMetrics { - SUM_W("The sum of wordlengths of all Symbols", false, s -> s.getCost(DummyCostEvaluator.COST_METRIC_NAME, ICostEvaluator.FULL_APPLICATION)), - AREA_MODEL("Simple area cost estimation based on a model of computation", false, s -> s.getCost(ComputationModelEvaluator.AREA_MODEL, ICostEvaluator.FULL_APPLICATION)), - ENERGY_MODEL("Simple energy estimation based on a model of computation", false, s -> s.getCost(ComputationModelEvaluator.ENERGY_MODEL, ICostEvaluator.FULL_APPLICATION)), + SUM_W("The sum of wordlengths of all Symbols", false, s -> s.getCost(DummyCostEvaluator.COST_METRIC_NAME, ICostEvaluator.FULL_APPLICATION), 20), + AREA_MODEL("Simple area cost estimation based on a model of computation", false, s -> s.getCost(ComputationModelEvaluator.AREA_MODEL, ICostEvaluator.FULL_APPLICATION), 500), + ENERGY_MODEL("Simple energy estimation based on a model of computation", false, s -> s.getCost(ComputationModelEvaluator.ENERGY_MODEL, ICostEvaluator.FULL_APPLICATION), 50), ; private ICostMetric metric; - private DefaultCostMetrics(String description, boolean higherIsBetter, Function<ISolution, Double> costMetric) { - metric = ICostMetric.createMetric(description, higherIsBetter, costMetric); + private DefaultCostMetrics(String description, boolean higherIsBetter, Function<ISolution, Double> costMetric, double normalizationRangeLB) { + metric = ICostMetric.createMetric(description, higherIsBetter, costMetric, normalizationRangeLB); } public ICostMetric getMetric() { diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/AbstractExplorationAlgorithm.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/AbstractExplorationAlgorithm.java index 308c1d2375025aef9f59bd49d32f253ccf02ab7d..d04ebf80853c729c44c30caf54ecc523c2895847 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/AbstractExplorationAlgorithm.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/AbstractExplorationAlgorithm.java @@ -9,10 +9,13 @@ import static java.util.stream.IntStream.range; import java.math.BigInteger; import java.nio.file.Path; import java.util.HashMap; +import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Optional; -import java.util.OptionalLong; +import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Logger; +import java.util.stream.Collectors; import org.eclipse.emf.common.util.EList; @@ -21,7 +24,7 @@ import com.google.common.base.Throwables; import fr.irisa.cairn.gecos.typeexploration.Components; import fr.irisa.cairn.gecos.typeexploration.accuracy.AccuracyEvaluationException; -import fr.irisa.cairn.gecos.typeexploration.accuracy.SSIMEvaluator; +import fr.irisa.cairn.gecos.typeexploration.accuracy.ITypeParamGenerator; import fr.irisa.cairn.gecos.typeexploration.accuracy.SimulationAccuracyEvaluator; import fr.irisa.cairn.gecos.typeexploration.cost.CostEvaluationException; import fr.irisa.cairn.gecos.typeexploration.model.IAccuracyEvaluator; @@ -34,14 +37,17 @@ import fr.irisa.cairn.gecos.typeexploration.model.IUserConstraint; import fr.irisa.cairn.gecos.typeexploration.solutionspace.SolutionSpaceAnalyzer; import fr.irisa.cairn.gecos.typeexploration.utils.ScatterChart; import gecos.core.Symbol; -import typeexploration.FixedPointTypeConfiguration; +import typeexploration.NumberTypeConfiguration; import typeexploration.SolutionSpace; /** * @author aelmouss */ public abstract class AbstractExplorationAlgorithm implements IExplorationAlgorithm { - + + protected Logger explorationStats; + protected List<String> explorationStatsNotesKeys; + protected Logger logger; protected IAccuracyEvaluator accuracyEvaluator; protected ICostEvaluator costEvaluator; @@ -49,10 +55,12 @@ public abstract class AbstractExplorationAlgorithm implements IExplorationAlgori protected IAccuracyMetric accuracyMetric; protected ICostMetric costMetric; protected IUserConstraint userAccuracyConstraint; + protected ITypeParamGenerator generator; // stats counters - protected int nbAccuracyEvals = 0; - protected int nbCostEvals = 0; + protected AtomicInteger nbIterations = new AtomicInteger(0); + protected AtomicInteger nbAccuracyEvals = new AtomicInteger(0); + protected AtomicInteger nbCostEvals = new AtomicInteger(0); // Charts to display results private ScatterChart accuracyChart; @@ -61,16 +69,13 @@ public abstract class AbstractExplorationAlgorithm implements IExplorationAlgori // private ScatterChart psnrDbChart; // private ScatterChart powerDbChart; - - protected Optional<Double> getAccuracy(ISolution s) { return accuracyMetric.getMetric(s); } protected Optional<Double> getCost(ISolution s) { return costMetric.getMetric(s); - } - + } protected void initialize() { if(accuracyEvaluator == null) { @@ -79,12 +84,15 @@ public abstract class AbstractExplorationAlgorithm implements IExplorationAlgori this.accuracyEvaluator = comp.getAccuEvaluator(); this.costEvaluator = comp.getCostEvaluator(); this.logger = comp.getExploartionLogger(); + this.explorationStats = comp.getExploartionStatsLogger(); this.enablePruning = comp.getConfiguration().isPruneSolutionSpaceFirst(); this.accuracyMetric = comp.getAccuracyMetric(); this.costMetric = comp.getCostMetric(); this.userAccuracyConstraint = comp.getAccuracyConstraint(); + this.generator = Objects.requireNonNull(Components.getInstance().getTypesGenerator(), "No Types generator component was registerd!"); + if(comp.getConfiguration().isEnableCharts()) { accuracyChart = new ScatterChart(accuracyMetric.getDescription(), "Accuracy" , "Solution ID", accuracyMetric.getDescription()); costChart = new ScatterChart(costMetric.getDescription(), "Cost" , "Solution ID", costMetric.getDescription()); @@ -95,15 +103,46 @@ public abstract class AbstractExplorationAlgorithm implements IExplorationAlgori } } + protected void parseOptions(String[] options) { + for (String option : options) { + String[] split = option.split("="); + if (split.length != 2) continue; + parseOption(split[0], split[1]); + } + } + + protected void parseOption(String name, String value) { + } + + /** + * This method should be overridden by a concrete subclass to specify + * the list of keys to query the notes field in ISolution. All values + * associated with a given key in this list is logged in the exploration + * stats log file. + * + * @return + */ + protected List<String> initializeNotesKeys() { + return null; + } + @Override - public ISolution explore(SolutionSpace solSpace) throws NoSolutionFoundException { + public ISolution explore(SolutionSpace solSpace, String[] options) throws NoSolutionFoundException { initialize(); + parseOptions(options); - Optional<BigInteger> sizeEstimate = solSpace.getAnalyzer().getSymbolsWithoutConstraints().stream().map(s->BigInteger.valueOf(streamSymboltypeConfigs(solSpace, s, Components.getInstance().getExplorationMode()).count())).reduce((x,y)->x.multiply(y)); + Optional<BigInteger> sizeEstimate = solSpace.getAnalyzer().getSymbolsWithoutConstraints().stream() + .map(s->BigInteger.valueOf(streamSymboltypeConfigs(solSpace, s, Components.getInstance().getExplorationMode()).count())) + .reduce((x,y)->x.multiply(y)); if (sizeEstimate.isPresent()) { logger.info(() -> "Rough Estimate of Solution Space Size: " + sizeEstimate.get()); } + explorationStatsNotesKeys = initializeNotesKeys(); + String vars = solSpace.getSymbols().stream().map(s->solSpace.getUniqueTypeName(s)).collect(Collectors.joining("\t")); + String notes = (explorationStatsNotesKeys!=null&&explorationStatsNotesKeys.size()>0)?explorationStatsNotesKeys.stream().collect(Collectors.joining("\t"))+"\t":""; + explorationStats.info("ID\tIteration\tAccuracy\tCost\t" + notes + vars); + if(enablePruning) pruneSpace(solSpace); @@ -123,13 +162,11 @@ public abstract class AbstractExplorationAlgorithm implements IExplorationAlgori + solution.metricDump() + printSolution(solution)); return solution; - } catch (NoSolutionFoundException e) { - throw e; } finally { afterExploration(); } } - + /** * @param solSpace * @return the solution that was found @@ -141,24 +178,24 @@ public abstract class AbstractExplorationAlgorithm implements IExplorationAlgori protected void evaluateAccuracy(ISolution sol) throws AccuracyEvaluationException { Stopwatch watch = Stopwatch.createStarted(); - nbAccuracyEvals++; + nbAccuracyEvals.incrementAndGet(); try { accuracyEvaluator.evaluate(sol); - logger.fine(() -> "Error stats for Solution " + sol.getID() + "\n" + printErrorStats(sol)); + logger.finest(() -> "Error stats for Solution " + sol.getID() + "\n" + printErrorStats(sol)); Double ssim = sol.getAccuracy(SimulationAccuracyEvaluator.METRIC_NAME_SSIM); if ( ssim != null) - logger.fine(() -> "SSIM for Solution " + sol.getID() + ": " + ssim ); + logger.finest(() -> "SSIM for Solution " + sol.getID() + ": " + ssim ); } catch (AccuracyEvaluationException e) { logger.severe("Failed to evaluate accuracy for solution " + sol.getID() + "\n" + Throwables.getStackTraceAsString(e)); throw e; } - logger.info(" *** Accuracy evaluation done in " + watch); + logger.finer(" *** Accuracy evaluation done in " + watch); } protected void evaluateCost(ISolution sol) throws CostEvaluationException { Stopwatch watch = Stopwatch.createStarted(); - nbCostEvals++; + nbCostEvals.incrementAndGet(); try { costEvaluator.evaluate(sol); logger.fine(() -> "Cost for Solution " + sol.getID() + " = " + getCost(sol).get()); @@ -167,7 +204,7 @@ public abstract class AbstractExplorationAlgorithm implements IExplorationAlgori throw e; } - logger.info(" *** Cost evaluation done in " + watch); + logger.fine(" *** Cost evaluation done in " + watch); } protected void display(ISolution sol) { @@ -182,6 +219,15 @@ public abstract class AbstractExplorationAlgorithm implements IExplorationAlgori } } + protected void log(ISolution sol) { + final double acc = (getAccuracy(sol).isPresent())?getAccuracy(sol).get():-1; + final double cost = (getCost(sol).isPresent())?getCost(sol).get():-1; + String msg = String.format("%d\t%d\t%f\t%f", sol.getID(), nbIterations.get(), acc, cost); + String notes = (explorationStatsNotesKeys!=null&&explorationStatsNotesKeys.size()>0)?explorationStatsNotesKeys.stream().map(k->sol.getNote(k)).collect(Collectors.joining("\t"))+"\t":""; + String types = sol.getSymbols().stream().map(s->generator.generate(sol.getType(s))).collect(Collectors.joining("\t")); + explorationStats.info(msg + "\t" + notes + types); + } + protected void afterExploration() { if(Components.getInstance().getConfiguration().isEnableCharts()) { Path expDir = Components.getInstance().getOutputLoactions().getExplorationDir(); @@ -208,7 +254,7 @@ public abstract class AbstractExplorationAlgorithm implements IExplorationAlgori if(minValidW == 0) return; - FixedPointTypeConfiguration configs = solSpace.getTypeFixedPtConfigs(symbol); + NumberTypeConfiguration configs = solSpace.getTypeFixedPtConfigs(symbol); if(configs == null) { // This is the case if the symbol isDefault and that the default configuration space had multiple Ws // In this case we add an explicit configuration space for the symbol with the pruned set of Ws. @@ -220,12 +266,15 @@ public abstract class AbstractExplorationAlgorithm implements IExplorationAlgori // Remove the first (invalid) Ws up to index minValidW-1 EList<Integer> widthValues = configs.getTotalWidthValues(); range(0, minValidW).forEach(i -> widthValues.remove(0)); - logger.info(() -> " - Reduced wordlengths set (by " + minValidW + ") of " + printSymbol(symbol) + " to: " + widthValues); + logger.fine(() -> " - Reduced wordlengths set (by " + minValidW + ") of " + printSymbol(symbol) + " to: " + widthValues); }); - + // reset solution space analyzer caches solSpace.getAnalyzer().reset(); + //pruning is counted as an iteration + nbIterations.incrementAndGet(); + logger.info(" *** Pruning Solution space done in " + watch); } @@ -237,6 +286,8 @@ public abstract class AbstractExplorationAlgorithm implements IExplorationAlgori evaluateAccuracy(solution); evaluateCost(solution); if(! userAccuracyConstraint.isValid(solution)) { + String printSolution = printSolution(solution); + logger.info("Max width solution tested : \n"+solution.metricDump() + printSolution); throw new NoSolutionFoundException("Using maximum allowed wordlengths for all variables still result in " + "violation of the User Accuracy constraint! (maxW accuracy = " + getAccuracy(solution).get() + ")\n" + "Consider increasing the allowed wordlengths, or relaxing the acuracy constraint."); @@ -293,6 +344,7 @@ public abstract class AbstractExplorationAlgorithm implements IExplorationAlgori try { evaluateAccuracy(solution); evaluateCost(solution); + log(solution); isValid = userAccuracyConstraint.isValid(solution); } catch (AccuracyEvaluationException | CostEvaluationException e) { logger.warning("Skipping pruning solution " + + solution.getID() + " of symbol " + s + "cause: " + e.getMessage()); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/BruteForceExploration.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/BruteForceExploration.java index bf2d5fa84dc170a5d7c47608862d6da01ed30928..1e36a20dd57ccc667a12155eb2d3a5b1233d951b 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/BruteForceExploration.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/BruteForceExploration.java @@ -7,6 +7,8 @@ import static java.util.stream.Collectors.toList; import java.util.List; import java.util.stream.Stream; +import org.javatuples.Pair; + import com.google.common.collect.Lists; import com.google.common.collect.Streams; @@ -75,7 +77,7 @@ public class BruteForceExploration extends AbstractExplorationAlgorithm { private ISolution createSolution(SolutionSpaceAnalyzer analyzer, List<TypeParam> list) { ISolution solution = UserFactory.solution(analyzer.getSolSpace()); Streams.zip(analyzer.getSymbolsWithoutConstraints().stream(), list.stream(), - (s, p) -> {solution.setType(s, p); return 0;}).forEach(x -> {}); + (s, p) -> new Pair<>(s, p)).forEach(pair -> solution.setType(pair.getValue0(), pair.getValue1()));; return solution; } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/DefaultAlgorithms.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/DefaultAlgorithms.java index ac4ce72436fedbc9583c6fd97e996b4b6e5762eb..d0ce11c2c5fb7671d2438dbbabf3b52272f42dc8 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/DefaultAlgorithms.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/DefaultAlgorithms.java @@ -7,7 +7,8 @@ import typeexploration.SolutionSpace; public enum DefaultAlgorithms implements IExplorationAlgorithm { BRUTE_FORCE(new BruteForceExploration()), MIN_PLUS_ONE(new MinPlusOneExploration()), - TABU_SEARCH(new TabuExploration()) + TABU_SEARCH(new TabuExploration()), + ENUMERATION(new Enumeration()) ; private IExplorationAlgorithm algo; @@ -16,7 +17,8 @@ public enum DefaultAlgorithms implements IExplorationAlgorithm { this.algo = algo; } - public ISolution explore(SolutionSpace solSpace) throws NoSolutionFoundException { - return algo.explore(solSpace); + @Override + public ISolution explore(SolutionSpace solSpace, String[] options) throws NoSolutionFoundException { + return algo.explore(solSpace, options); } } \ No newline at end of file diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/Enumeration.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/Enumeration.java new file mode 100644 index 0000000000000000000000000000000000000000..db7915297ff9ff88e63dd5e3a6d70887d54efbc0 --- /dev/null +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/Enumeration.java @@ -0,0 +1,238 @@ +package fr.irisa.cairn.gecos.typeexploration.dse; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import fr.irisa.cairn.gecos.typeexploration.accuracy.AccuracyEvaluationException; +import fr.irisa.cairn.gecos.typeexploration.cost.CostEvaluationException; +import fr.irisa.cairn.gecos.typeexploration.model.ISolution; +import fr.irisa.cairn.gecos.typeexploration.model.UserFactory; +import gecos.core.Symbol; +import gecos.types.OverflowMode; +import gecos.types.QuantificationMode; +import typeexploration.FixedPointTypeParam; +import typeexploration.SolutionSpace; +import typeexploration.TypeParam; + +public class Enumeration extends AbstractExplorationAlgorithm { + + protected SolutionSpace solSpace; + protected String[] files; + protected List<SolutionSpaceFromFile> solSpaceFromFiles; + + protected ISolution optimalSolution; + + @Override + protected List<String> initializeNotesKeys() { + List<String> list = new ArrayList<String>( 1 ); + + list.add("name"); + + return list; + } + + @Override + public ISolution runExploration(SolutionSpace solSpace) throws NoSolutionFoundException { + this.solSpace = solSpace; + this.solSpaceFromFiles = new ArrayList<>(files.length); + + for (String file : files) { + SolutionSpaceFromFile ssff = new SolutionSpaceFromFile(file); + ssff.load(); + solSpaceFromFiles.add(ssff); + } + + exploreAllCombinations(null, 0); + + //currently, it is just the first solution + return optimalSolution; + } + + @Override + protected void parseOption(String name, String value) { + if (name.contentEquals("files")) { + files = value.split(","); + } + } + + protected void exploreAllCombinations(List<ISolution> comb, int depth) { + //base case + if (depth >= solSpaceFromFiles.size()) { + try { + ISolution merged = mergeSolutions(comb); + evaluateAccuracy(merged); + evaluateCost(merged); + log(merged); + if (optimalSolution == null) optimalSolution = merged; + } catch (AccuracyEvaluationException | CostEvaluationException e) { + logger.warning("Error while evaluation solutions :" + e.getMessage()); + } + } else { + List<ISolution> solutions = solSpaceFromFiles.get(depth).solutions; + for (ISolution sol : solutions) { + List<ISolution> list; + if (comb == null) { + list = new LinkedList<ISolution>(); + } else { + list = new LinkedList<ISolution>(comb); + } + list.add(sol); + exploreAllCombinations(list, depth+1); + } + } + } + + protected ISolution mergeSolutions(List<ISolution> solutions) { + ISolution mergedSol = UserFactory.solution(solSpace); + + String name = solutions.stream().map(s->s.getNote("name")).collect(Collectors.joining("-")); + mergedSol.setNote("name", name); + + for (ISolution solution : solutions) { + for (Symbol symbol : solution.getSymbols()) { + if (mergedSol.getType(symbol) == null) { + mergedSol.setType(symbol, solution.getType(symbol)); + } else { + TypeParam mergedType = mergeTypeParam(mergedSol.getType(symbol), solution.getType(symbol)); + mergedSol.setType(symbol, mergedType); + } + } + } + + return mergedSol; + } + + protected TypeParam mergeTypeParam(TypeParam typeA, TypeParam typeB) { + if (typeA instanceof FixedPointTypeParam && typeB instanceof FixedPointTypeParam) { + return mergeTypeParam((FixedPointTypeParam)typeA, (FixedPointTypeParam)typeB); + } + + throw new IllegalArgumentException("Canot merge two types of different kind: " + typeA + " " + typeB); + } + protected TypeParam mergeTypeParam(FixedPointTypeParam typeA, FixedPointTypeParam typeB) { + if (typeA.isSigned() != typeB.isSigned()) { + throw new IllegalArgumentException("Signed must match."); + } + if (typeA.getQuantificationMode() != typeB.getQuantificationMode()) { + throw new IllegalArgumentException("Quantification Mode must match."); + } + if (typeA.getOverflowMode() != typeB.getOverflowMode()) { + throw new IllegalArgumentException("Overflow Mode must match."); + } + + int W = Math.min(typeA.getTotalWidth(), typeB.getTotalWidth()); + int I = Math.min(typeA.getIntegerWidth(), typeB.getIntegerWidth()); + boolean signed = typeA.isSigned(); + QuantificationMode Q = typeA.getQuantificationMode(); + OverflowMode O = typeA.getOverflowMode(); + + FixedPointTypeParam mergedType = UserFactory.fixedTypeParam(W, I, signed, Q, O); + if (!mergedType.equals(typeA) && !mergedType.equals(typeB)) { + throw new IllegalArgumentException("Expecting the merged type to match one of the input types."); + } + + return mergedType; + } + + private static final Pattern acFixedFull = Pattern.compile("ac_fixed<(\\d+), ((-|\\+)?\\d+), 1, AC_TRN, AC_WRAP>"); + private static final Pattern acFixedShort = Pattern.compile("W=(\\d+) I=((-|\\+)?\\d+)"); + + protected class SolutionSpaceFromFile { + + protected final String file; + protected List<ISolution> solutions; + + public SolutionSpaceFromFile(String file) { + this.file = file; + solutions = new LinkedList<>(); + } + + protected void load() { + BufferedReader reader; + try { + reader = new BufferedReader(new FileReader(file)); + + String labelLine = reader.readLine().replaceAll("\r|\n", ""); + String[] labels = labelLine.split("\t"); + + if (labels.length < 2 || !labels[0].contentEquals("name")) { + reader.close(); + throw new IllegalArgumentException("Expecting first row to be labels, and the first column should be 'name'"); + } + + List<Symbol> symbols = new ArrayList<Symbol>(labels.length-1); + { + //Create a map from unique name for each variable to symbol + Map<String, Symbol> reverseMap = new TreeMap<>(); + for (Symbol s : solSpace.getSymbols()) { + reverseMap.put(solSpace.getUniqueTypeName(s), s); + } + + //Then make sure that each label corresponds to a symbol, + // while constructing a list that mapps indices to symbol + for (int i = 1; i < labels.length; i++) { + if (reverseMap.get(labels[i]) == null) { + reader.close(); + throw new RuntimeException("Solution space does not include specified type: " + labels[i]); + } + symbols.add(reverseMap.get(labels[i])); + } + } + + String line = reader.readLine(); + while (line != null) { + String[] values = line.replaceAll("\r|\n", "").split("\t"); + + if (values.length > 1) { + ISolution sol = UserFactory.solution(solSpace); + sol.setNote("name",values[0]); + + for (int i = 1; i < values.length; i++) { + sol.setType(symbols.get(i-1), parse(values[i])); + } + + solutions.add(sol); + } + + line = reader.readLine(); + } + + reader.close(); + } catch (IOException ioe) { + throw new RuntimeException(ioe); + } + } + + private TypeParam parse(String type) { + int W=32; + int I=16; + boolean signed = true; + QuantificationMode Q = QuantificationMode.AC_TRN; + OverflowMode O = OverflowMode.AC_WRAP; + + Matcher matcherShort = acFixedShort.matcher(type); + Matcher matcherFull = acFixedFull.matcher(type); + + if (matcherFull.matches()) { + W = Integer.parseInt(matcherFull.group(1)); + I = Integer.parseInt(matcherFull.group(2)); + } else if (matcherShort.matches()) { + W = Integer.parseInt(matcherShort.group(1)); + I = Integer.parseInt(matcherShort.group(2)); + } else { + throw new RuntimeException("Unable to parse type specification: " + type); + } + + return UserFactory.fixedTypeParam(W, I, signed, Q, O); + } + } +} diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/MinPlusOneExploration.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/MinPlusOneExploration.java index d079a8e299bb5f5d0a9dca756012244b18df18c8..037517812d3c3c30007f136a529367e34f35de1f 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/MinPlusOneExploration.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/MinPlusOneExploration.java @@ -33,7 +33,7 @@ public class MinPlusOneExploration extends AbstractExplorationAlgorithm { @Override public ISolution runExploration(SolutionSpace solSpace) throws NoSolutionFoundException { logger.info(" *** Starting MinPlusOne Exploration"); - + try { evaluateMaxWsSolution(solSpace, userAccuracyConstraint); } catch (AccuracyEvaluationException | CostEvaluationException e) { @@ -128,7 +128,7 @@ public class MinPlusOneExploration extends AbstractExplorationAlgorithm { })); /* select the next Solution that results in the maximum 'accuracy improvement to cost increase' ratio */ - logger.info("Evaluating next candidates ..."); + logger.fine("Evaluating next candidates ..."); Stopwatch w = Stopwatch.createStarted(); WordLengthsExplorer best = selectBestNext(currentExplorer.getLastCreatedSolution(), nextSolutionCandidates); logger.info("Evaluating candiates finished in " + w); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/SolutionImpl.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/SolutionImpl.java deleted file mode 100644 index 0bd0e1a84f3c51c72ca66dcd8fef0ec85f9230a1..0000000000000000000000000000000000000000 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/SolutionImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -package fr.irisa.cairn.gecos.typeexploration.dse; - -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -import fr.irisa.cairn.gecos.typeexploration.model.AbstractSolution; -import fr.irisa.cairn.gecos.typeexploration.model.ISolution; -import fr.irisa.cairn.gecos.typeexploration.solutionspace.SolutionSpaceAnalyzer; -import gecos.core.Symbol; -import typeexploration.SolutionSpace; -import typeexploration.TypeParam; - -/** - * @author aelmouss - */ -public class SolutionImpl extends AbstractSolution { - - protected Map<Symbol, TypeParam> symbolBaseTypes; //! should not be publicly exposed since getType() handles automatic completion - - public SolutionImpl(SolutionSpace solSpace) { - super(solSpace); - this.symbolBaseTypes = new HashMap<>(); - } - - @Override - public void setType(Symbol s, TypeParam t) { - symbolBaseTypes.put(s, t); - } - - @Override - public TypeParam getType(Symbol s) { - TypeParam t = symbolBaseTypes.get(s); - if(t == null) { - Symbol sameAs = solSpace.getAnalyzer().getSymbolsWithSame().get(s); - if(sameAs != null) - t = getType(sameAs); - } - return t; - } - - - - /** - * NOTE: this completion is now automatically performed by {@link #getType(Symbol)}. - * <br> - * For each symbol with SAME constraint, assign the same type as its source, in the specified solution. - * @param solution partial solution that must cover at least all symbols without SAME - * ( {@link SolutionSpaceAnalyzer#getSymbolsWithoutConstraints()} ) - * @return the solution after being completed - */ - public static ISolution completeSolution(ISolution solution) { - solution.getSolutionSpace().getAnalyzer().getSymbolsWithSame().entrySet().forEach(e -> { - Symbol sameAs = Objects.requireNonNull(e.getValue(), "The source symbol cannot be null"); - TypeParam sameAsType = Objects.requireNonNull(solution.getType(sameAs)); - solution.setType(e.getKey(), sameAsType); - }); - return solution; - } - -} diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/TabuExploration.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/TabuExploration.java index 8d0a3e6c3c9dd701185ae231935579a2b193e874..52f855dc9f11c83c9eb1e7145c02cc591e69084e 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/TabuExploration.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/TabuExploration.java @@ -3,11 +3,13 @@ package fr.irisa.cairn.gecos.typeexploration.dse; import static java.util.stream.Collectors.toList; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.LinkedList; import java.util.List; import com.google.common.base.Preconditions; import com.google.common.base.Stopwatch; -import com.google.common.collect.Streams; import fr.irisa.cairn.gecos.model.utils.misc.ThreadUtils; import fr.irisa.cairn.gecos.model.utils.misc.ValuesNormalizer; @@ -20,13 +22,23 @@ import gecos.core.Symbol; import typeexploration.SolutionSpace; /** - * @author phuhv + * @author aelmouss */ public class TabuExploration extends AbstractExplorationAlgorithm { protected boolean directionUp = true; protected ISolution optimalSol; + @Override + protected List<String> initializeNotesKeys() { + List<String> list = new ArrayList<String>(); + + list.add("gradient"); + list.add("selected"); + + return list; + } + /** * {@inheritDoc} * @@ -58,6 +70,7 @@ public class TabuExploration extends AbstractExplorationAlgorithm { evaluateAccuracy(solution); evaluateCost(solution); display(solution); + log(solution); } catch (AccuracyEvaluationException | CostEvaluationException e) { //!!! aelmouss: // @@ -73,6 +86,8 @@ public class TabuExploration extends AbstractExplorationAlgorithm { // throw new RuntimeException(e); } + //Initial solution should be counted as a separate iteration + nbIterations.incrementAndGet(); List<Symbol> finished = new ArrayList<>(); @@ -106,6 +121,7 @@ public class TabuExploration extends AbstractExplorationAlgorithm { + "cost = " + getCost(solution).get()); } } + nbIterations.incrementAndGet(); } if(!getAccuracy(optimalSol).isPresent() || !getCost(optimalSol).isPresent()) @@ -170,7 +186,7 @@ public class TabuExploration extends AbstractExplorationAlgorithm { logger.warning("Skipping next solution (direction down) candidate: " + nextSolution.getID() + " cause: " + e.getMessage()); } } - else if (indexMax == 0) { + else { synchronized (finished) { logger.fine(() -> "Symbol exploration finished; already at " + (directionUp? "max W & direction is up" : "min W & direction is down") + ": " + symbol); newlyFinished.add(symbol); @@ -191,8 +207,31 @@ public class TabuExploration extends AbstractExplorationAlgorithm { WordLengthsExplorer best = selectBestNext(currentExplorer.getLastCreatedSolution(), nextSolutionCandidates, finished); logger.info("Evaluating candiates finished in " + w); + /* Once the next best is found, emit all the logs for this iteration */ + for (WordLengthsExplorer wle : nextSolutionCandidates) { + log(wle.currentSolution); + } + return best; } + + private void checkAndUpdateCurrentOptimal(ISolution newSol) { + if (!userAccuracyConstraint.isValid(newSol)) return; + + if (!userAccuracyConstraint.isValid(optimalSol)) { + optimalSol = newSol; + return; + } + + double currentCost = getCost(optimalSol).get(); + double currentAcc = getAccuracy(optimalSol).get(); + + double newCost = getCost(newSol).get(); + double newAcc = getAccuracy(newSol).get(); + + if (newCost < currentCost) optimalSol = newSol; + if (newCost == currentCost && newAcc > currentAcc) optimalSol = newSol; + } private WordLengthsExplorer selectBestNext(ISolution currentSolution, List<WordLengthsExplorer> nextSolutionCandidates, List<Symbol> finished) { if(nextSolutionCandidates.isEmpty()) { @@ -200,61 +239,93 @@ public class TabuExploration extends AbstractExplorationAlgorithm { return null; } - List<WordLengthsExplorer> listSolution = nextSolutionCandidates; - - for (WordLengthsExplorer temp : listSolution) { - if(userAccuracyConstraint.isValid(temp.currentSolution)) - { - if(!userAccuracyConstraint.isValid(optimalSol)) // first assignment - { - optimalSol = temp.currentSolution; - } - if(getCost(optimalSol).get() > getCost(temp.currentSolution).get()) - { - optimalSol = temp.currentSolution; - } - if(getCost(optimalSol).get() == getCost(temp.currentSolution).get()) - { - if(getAccuracy(optimalSol).get() < getAccuracy(temp.currentSolution).get()) - { - optimalSol = temp.currentSolution; - } - } + Collections.sort(nextSolutionCandidates, new Comparator<WordLengthsExplorer>() { + @Override + public int compare(WordLengthsExplorer o1, WordLengthsExplorer o2) { + return o1.getLastModifiedSymbol().getName().compareTo(o2.getLastModifiedSymbol().getName()); } - } + + }); + + //update optimal solution + nextSolutionCandidates.stream().forEachOrdered(s->checkAndUpdateCurrentOptimal(s.currentSolution)); + + List<Integer> lastModifiedWLs = nextSolutionCandidates.stream() + .map(e -> e.getCurrentW(e.lastModifiedSymbol)) + .collect(toList()); List<Double> accuracyValues = nextSolutionCandidates.stream() - .map(e -> getAccuracy(e.getLastCreatedSolution()).get()) - .collect(toList()); - ValuesNormalizer accuracyNormalizer = new ValuesNormalizer(accuracyValues); + .map(e -> getAccuracy(e.getLastCreatedSolution()).get()) + .collect(toList()); List<Double> costValues = nextSolutionCandidates.stream() .map(e -> getCost(e.getLastCreatedSolution()).get()) .collect(toList()); - ValuesNormalizer costNormalizer = new ValuesNormalizer(costValues); + ValuesNormalizer accuracyNormalizer = new ValuesNormalizer(accuracyValues); + ValuesNormalizer costNormalizer = new ValuesNormalizer(costValues); + //FIXME these values are currently arbitrary + { + //max must be obtained before setting min or range, since it is computed from min and range + final double accMax = accuracyNormalizer.getMax(); + final double costMax = costNormalizer.getMax(); + accuracyNormalizer.setRange(Math.max(accuracyMetric.getNormalizationRangeLB(), accuracyNormalizer.getRange())); + accuracyNormalizer.setMin(accMax-accuracyNormalizer.getRange()); + costNormalizer.setRange(Math.max(costMetric.getNormalizationRangeLB(), costNormalizer.getRange())); + costNormalizer.setMin(costMax-costNormalizer.getRange()); + } + Double normalizedCurrentAccuray = getAccuracy(currentSolution).map(accuracyNormalizer::normalize).orElse(null); Double normalizedCurrentCost = getCost(currentSolution).map(costNormalizer::normalize).orElse(null); + + List<Double> normalizedAccuracyValues = accuracyNormalizer.normalize(accuracyValues); + List<Double> normalizedCostValues = costNormalizer.normalize(costValues); - List<Double> criteria = Streams.zip( - accuracyNormalizer.normalize(accuracyValues).stream(), - costNormalizer.normalize(costValues).stream(), - (nextAccuray, nextCost) -> - (1 + computeImprovement(normalizedCurrentAccuray, nextAccuray, accuracyMetric.isHigherBetter())) / - (1 + computeDegradation(normalizedCurrentCost, nextCost, costMetric.isHigherBetter()))) - .collect(toList()); + List<Double> criteria = new LinkedList<>(); + for (int i = 0; i < nextSolutionCandidates.size(); i++) { + Integer lastModifiedWL = lastModifiedWLs.get(i); + Double normalizedAccuracyValue = normalizedAccuracyValues.get(i); + Double normalizedCostValue = normalizedCostValues.get(i); + Double ratio = (1 + computeImprovement(normalizedCurrentAccuray, normalizedAccuracyValue, accuracyMetric.isHigherBetter())) / + (1 + computeDegradation(normalizedCurrentCost, normalizedCostValue, costMetric.isHigherBetter())); + + //FIXME bias strength is currently not well thought out + Double WLbias = Math.pow(lastModifiedWL.doubleValue(), 1.2) / (350); //TODO try 250 + + final Double criterion; + + if (directionUp) + criterion = ratio - WLbias; + else + criterion = ratio + WLbias; + + WordLengthsExplorer candidate = nextSolutionCandidates.get(i); + logger.info(String.format("TabuSearchMetric (%s; WL:%d, Acc:%f, Cost:%f, NormAcc:%f, NormCost:%f): %f -> %f", + candidate.getLastModifiedSymbol().getName(), lastModifiedWL.intValue(), + accuracyValues.get(i), costValues.get(i), + normalizedAccuracyValue, normalizedCostValue, + ratio, criterion)); + + criteria.add(criterion); + nextSolutionCandidates.get(i).currentSolution.setNote("gradient", criterion+""); + nextSolutionCandidates.get(i).currentSolution.setNote("selected", "F"); + } + final WordLengthsExplorer nextBest; if(directionUp) { - return criteria.stream() + nextBest = criteria.stream() .max(Double::compare) .map(max -> nextSolutionCandidates.get(criteria.indexOf(max))) .orElse(null); } else { - return criteria.stream() + nextBest = criteria.stream() .min(Double::compare) .map(min -> nextSolutionCandidates.get(criteria.indexOf(min))) .orElse(null); } + nextBest.currentSolution.setNote("selected", "T"); + + return nextBest; } /** @@ -276,8 +347,7 @@ public class TabuExploration extends AbstractExplorationAlgorithm { if(higherIsBetter) diff = -diff; -// if (Math.abs(diff) < 0.0000001) { - if (Math.abs(diff) < 0.000000000001) { + if (Math.abs(diff) < 0.0000001) { diff = 0; } return diff + 1; @@ -293,28 +363,5 @@ public class TabuExploration extends AbstractExplorationAlgorithm { double degradation = 2 - computeImprovement(currentNormalized, nextNormalized, higherIsBetter); return degradation; } - - -// private WordLengthsExplorer selectBestNext(ISolution currentSolution, List<WordLengthsExplorer> nextSolutionCandidates) { -// return nextSolutionCandidates.stream() -// .reduce((e1, e2) -> { -// double c1 = computeCriterion(e1.getLastCreatedSolution(), currentSolution); -// double c2 = computeCriterion(e2.getLastCreatedSolution(), currentSolution); -// return c1 > c2 ? e1 : e2; -// }) -// .orElse(null); -// } -// -// private double computeCriterion(ISolution nextSolution, ISolution currentSolution) { -// double currentAccuray = getAccuracyMetric(currentSolution); -// double currentCost = currentSolution.getCost(); -// double nextAccuray = getAccuracyMetric(nextSolution); -// double nextCost = nextSolution.getCost(); -// -// //FIXME: use a normalized cost and let the denominator be (1 + (currentCost - nextCost)) -// if(currentCost - nextCost == 0) -// throw new RuntimeException("FIXME: the criterion computation encountered a divide by 0."); -// return (currentAccuray - nextAccuray) / (currentCost - nextCost); -// } } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/WordLengthsExplorer.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/WordLengthsExplorer.java index d4b8463a31fb423b4ff1b13f5da01fa860e76d2d..768c7adf8a8282b84150749fe4b6577b6df9aee5 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/WordLengthsExplorer.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/dse/WordLengthsExplorer.java @@ -17,124 +17,145 @@ import typeexploration.FixedPointTypeConfiguration; import typeexploration.FixedPointTypeParam; import typeexploration.FloatPointTypeConfiguration; import typeexploration.FloatPointTypeParam; +import typeexploration.NumberTypeConfiguration; import typeexploration.SolutionSpace; import typeexploration.TypeParam; /** - * Currently only explores wordlengths. - * For other type parameters are currently fixed to their first possible - * value specified in the solution space. + * Currently only explores wordlengths. For other type parameters are currently + * fixed to their first possible value specified in the solution space. * * @author aelmouss */ public class WordLengthsExplorer { - - protected SolutionSpaceAnalyzer analyzer; + + protected SolutionSpaceAnalyzer analyzer; protected Map<Symbol, Integer> symbolWs; protected TypeParamExplorer typeParamsExplorer; - - + private abstract class TypeParamExplorer { abstract List<Integer> getWidths(Symbol s); + abstract TypeParamExplorer copy(); + abstract TypeParam createCurrentType(Symbol s, Integer currentW); } - + private class FixedPointParamExplorer extends TypeParamExplorer { protected Map<Symbol, Integer> symbolIs; + protected Map<Symbol, Boolean> symbolSs; protected Map<Symbol, QuantificationMode> symbolQMods; protected Map<Symbol, OverflowMode> symbolSMods; - + FixedPointParamExplorer() { this.symbolIs = new HashMap<>(); + this.symbolSs = new HashMap<>(); this.symbolQMods = new HashMap<>(); this.symbolSMods = new HashMap<>(); - - //XXX TMP: currently use the first possible value of each parameter. - //TODO add support to specify different values for these parameters - analyzer.getSymbolsWithoutConstraints().forEach(s -> { + + // XXX TMP: currently use the first possible value of each parameter. + // TODO add support to specify different values for these parameters + WordLengthsExplorer.this.analyzer.getSymbolsWithoutConstraints().forEach(s -> { FixedPointTypeConfiguration config = getFixedPointConfiguration(s); symbolIs.put(s, config.getIntegerWidthValues().get(0)); + symbolSs.put(s, config.getSigned().get(0)); symbolQMods.put(s, config.getQuantificationMode().get(0)); symbolSMods.put(s, config.getOverflowMode().get(0)); }); } - + private FixedPointTypeConfiguration getFixedPointConfiguration(Symbol s) { - return analyzer.getFixedPointConfigurationOrDefault(s); + return WordLengthsExplorer.this.analyzer.getFixedPointConfigurationOrDefault(s); } - + @Override public List<Integer> getWidths(Symbol s) { - FixedPointTypeConfiguration config = getFixedPointConfiguration(s); + NumberTypeConfiguration config = getFixedPointConfiguration(s); return config.getTotalWidthValues(); } - + @Override public FixedPointParamExplorer copy() { - return this; //XXX only works currently since params are fixed! + FixedPointParamExplorer typeParam = new FixedPointParamExplorer(); + typeParam.symbolIs.putAll(symbolIs); + typeParam.symbolSs.putAll(symbolSs); + typeParam.symbolQMods.putAll(symbolQMods); + typeParam.symbolSMods.putAll(symbolSMods); + return typeParam; } @Override public FixedPointTypeParam createCurrentType(Symbol s, Integer currentW) { - return UserFactory.fixedTypeParam(currentW, symbolIs.get(s), symbolQMods.get(s), symbolSMods.get(s)); + Integer i = symbolIs.get(s); + Boolean sign = symbolSs.get(s); + QuantificationMode q = symbolQMods.get(s); + OverflowMode o = symbolSMods.get(s); + return UserFactory.fixedTypeParam(currentW, i, sign, q, o); } } - + private class FloatingPointParamExplorer extends TypeParamExplorer { protected Map<Symbol, Integer> symbolEs; - + protected Map<Symbol, Boolean> symbolSs; + public FloatingPointParamExplorer() { this.symbolEs = new HashMap<>(); - - //XXX TMP: currently use the first possible value of each parameter. - //TODO add support to specify different values for these parameters - analyzer.getSymbolsWithoutConstraints().forEach(s -> { + this.symbolSs = new HashMap<>(); + + // XXX TMP: currently use the first possible value of each parameter. + // TODO add support to specify different values for these parameters + WordLengthsExplorer.this.analyzer.getSymbolsWithoutConstraints().forEach(s -> { FloatPointTypeConfiguration config = getFloatPointConfiguration(s); symbolEs.put(s, config.getExponentWidthValues().get(0)); + symbolSs.put(s, config.getSigned().get(0)); }); } - + private FloatPointTypeConfiguration getFloatPointConfiguration(Symbol s) { - return analyzer.getFloatPointConfigurationOrDefault(s); + return WordLengthsExplorer.this.analyzer.getFloatPointConfigurationOrDefault(s); } - + @Override public List<Integer> getWidths(Symbol s) { FloatPointTypeConfiguration config = getFloatPointConfiguration(s); return config.getTotalWidthValues(); } - + @Override public FloatingPointParamExplorer copy() { - return this; //XXX only works currently since params are fixed! + FloatingPointParamExplorer typeParam = new FloatingPointParamExplorer(); + typeParam.symbolEs.putAll(symbolEs); + typeParam.symbolSs.putAll(symbolSs); + return typeParam; } - + @Override public FloatPointTypeParam createCurrentType(Symbol s, Integer currentW) { - return UserFactory.floatTypeParam(currentW, symbolEs.get(s)); + return UserFactory.floatTypeParam(currentW, symbolEs.get(s), symbolSs.get(s)); } } - - + public WordLengthsExplorer(SolutionSpace solSpace) { this.analyzer = solSpace.getAnalyzer(); this.symbolWs = new HashMap<>(); - + ExplorationMode explorationMode = Components.getInstance().getExplorationMode(); - switch(explorationMode) { + switch (explorationMode) { case FIXED: - this.typeParamsExplorer = new FixedPointParamExplorer(); break; + this.typeParamsExplorer = new FixedPointParamExplorer(); + break; case FLOAT: - this.typeParamsExplorer = new FloatingPointParamExplorer(); break; + this.typeParamsExplorer = new FloatingPointParamExplorer(); + break; case MIXED: default: throw new RuntimeException("This exploration mode is not supported yet: " + explorationMode); } } - - protected WordLengthsExplorer() { } - + + protected WordLengthsExplorer() { + } + public WordLengthsExplorer copy() { WordLengthsExplorer copy = new WordLengthsExplorer(); copy.analyzer = this.analyzer; @@ -146,61 +167,53 @@ public class WordLengthsExplorer { protected Integer getCurrentW(Symbol s) { return symbolWs.get(s); } - + public Integer getCurrentWIdx(Symbol s) { return getWidths(s).indexOf(getCurrentW(s)); } - + public int getMaxWIdx(Symbol s) { List<Integer> widths = getWidths(s); - return widths.size() -1; + return widths.size() - 1; } - + public Integer getMaxW(Symbol s) { List<Integer> widths = getWidths(s); - return widths.get(widths.size() -1); + return widths.get(widths.size() - 1); } - /** * Unique and sorted (min first) + * * @param s * @return */ protected List<Integer> getWidths(Symbol s) { return typeParamsExplorer.getWidths(s); } - - + protected ISolution currentSolution; - + public ISolution createCurrentSolution() { ISolution sol = UserFactory.solution(analyzer.getSolSpace()); - analyzer.getSymbolsWithoutConstraints().forEach(s -> - sol.setType(s, typeParamsExplorer.createCurrentType(s, getCurrentW(s)))); - + analyzer.getSymbolsWithoutConstraints().forEach(s -> { + Integer currentW = getCurrentW(s); + TypeParam createCurrentType = typeParamsExplorer.createCurrentType(s, currentW); + sol.setType(s, createCurrentType); + }); + currentSolution = sol; return currentSolution; } - + public ISolution getLastCreatedSolution() { return currentSolution; } - -// protected boolean hasChanged() { -// Objects.requireNonNull(currentSolution); -// //TODO also check for I, qMod ... -// return currentSolution.getSymbols().stream().anyMatch(s -> { -// TypeParam type = currentSolution.getType(s); -// Integer lastW = type == null ? null : type.getTotalWidth(); -// return ! Objects.equals(getCurrentW(s), lastW); -// }); -// } - /** - * Set W(s) as the wIdx'th width in the ordered (min-first) list of all possible - * bit widths for s. + * Set W(s) as the wIdx'th width in the ordered (min-first) list of all possible + * bit widths for s. + * * @param s * @param wIdx */ @@ -209,7 +222,7 @@ public class WordLengthsExplorer { Preconditions.checkArgument(wIdx >= 0 && wIdx < widths.size(), "index out of range", wIdx); Integer w = widths.get(wIdx); symbolWs.put(s, w); - + lastModifiedSymbol = s; } @@ -224,45 +237,47 @@ public class WordLengthsExplorer { public void setAllWToMin() { analyzer.getSymbolsWithoutConstraints().forEach(this::setWToMin); } - + public void setAllWToMax() { analyzer.getSymbolsWithoutConstraints().forEach(this::setWToMax); } /** - * Set W of symbol the next higer one (i.e. current index+1) and return true, if present. Otherwise - * do nothing and return false. + * Set W of symbol the next higer one (i.e. current index+1) and return true, if + * present. Otherwise do nothing and return false. + * * @param symbol * @return true if changed. false if symbol is already at its max W. */ public boolean setToNextHigherW(Symbol symbol) { int currentIdx = getCurrentWIdx(symbol); - if(currentIdx < getMaxWIdx(symbol)) { - setWTo(symbol, currentIdx+1); + if (currentIdx < getMaxWIdx(symbol)) { + setWTo(symbol, currentIdx + 1); return true; } return false; } /** - * Set W of symbol the next lower one (i.e. current index-1) and return true, if present. Otherwise - * do nothing and return false. + * Set W of symbol the next lower one (i.e. current index-1) and return true, if + * present. Otherwise do nothing and return false. + * * @param symbol * @return true if changed. false if symbol is already at its min W. */ public boolean setToNextLowerW(Symbol symbol) { int currentIdx = getCurrentWIdx(symbol); - if(currentIdx > 0) { - setWTo(symbol, currentIdx-1); + if (currentIdx > 0) { + setWTo(symbol, currentIdx - 1); return true; } return false; } - + protected Symbol lastModifiedSymbol; - + public Symbol getLastModifiedSymbol() { return lastModifiedSymbol; } - + } \ No newline at end of file diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/IAccuracyMetric.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/IAccuracyMetric.java index bb4c3a422daab883f54d7c2c25d6fc5080eea0c1..65adbe7b6b84471de9de5e8e672556b38e344268 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/IAccuracyMetric.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/IAccuracyMetric.java @@ -4,11 +4,12 @@ import java.util.function.Function; public class IAccuracyMetric extends IMetric { - public static IAccuracyMetric createMetric(String description, boolean higherIsBetter, Function<ISolution, Double> metric) { + public static IAccuracyMetric createMetric(String description, boolean higherIsBetter, Function<ISolution, Double> metric, double normalizationRangeLB) { IAccuracyMetric m = new IAccuracyMetric(); m.description = description; m.higherIsBetter = higherIsBetter; m.metric = metric; + m.normalizationRangeLB = normalizationRangeLB; return m; } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/ICostMetric.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/ICostMetric.java index c908d2086df3437dfc6905875b8c7be6ca7c98ff..81b35a0ed05aef7b75712bc4d926fc3c1d577806 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/ICostMetric.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/ICostMetric.java @@ -4,11 +4,12 @@ import java.util.function.Function; public class ICostMetric extends IMetric { - public static ICostMetric createMetric(String description, boolean higherIsBetter, Function<ISolution, Double> metric) { + public static ICostMetric createMetric(String description, boolean higherIsBetter, Function<ISolution, Double> metric, double normalizationRangeLB) { ICostMetric m = new ICostMetric(); m.description = description; m.higherIsBetter = higherIsBetter; m.metric = metric; + m.normalizationRangeLB = normalizationRangeLB; return m; } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/IExplorationAlgorithm.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/IExplorationAlgorithm.java index 6e0fa16f8d08e100b7bbd899e830a4de5647de4d..41cf386fad75c0642240031fa25af21579f41bf1 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/IExplorationAlgorithm.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/IExplorationAlgorithm.java @@ -8,6 +8,6 @@ import typeexploration.SolutionSpace; */ public interface IExplorationAlgorithm { - public ISolution explore(SolutionSpace solSpace) throws NoSolutionFoundException; + public ISolution explore(SolutionSpace solSpace, String[] options) throws NoSolutionFoundException; } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/IMetric.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/IMetric.java index 9387cae8d65075d83bf27a82cd37394869d52a75..71ee761bccd40fba923395815cca7df40f25a3f4 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/IMetric.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/IMetric.java @@ -13,6 +13,7 @@ public abstract class IMetric { protected String description; protected boolean higherIsBetter; protected Function<ISolution, Double> metric; + protected double normalizationRangeLB; protected void setDescription(String description) { @@ -26,6 +27,14 @@ public abstract class IMetric { protected void setMetric(Function<ISolution, Double> metric) { this.metric = metric; } + + protected void setNormalizationRangeLB(double lb) { + normalizationRangeLB = lb; + } + + public double getNormalizationRangeLB() { + return normalizationRangeLB; + } /** * @return true to indicate that this metric is considered better diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/ISolution.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/ISolution.java index 3929b77e52f3a929bf59d7e86d369eff23044b8b..76a9d5428dc4c3d7c3789dccf1c62ecfcc5e1ef5 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/ISolution.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/ISolution.java @@ -20,6 +20,16 @@ public interface ISolution { void setType(Symbol s, TypeParam t); TypeParam getType(Symbol s); + /** + * Note is an arbitrary piece of String that is emitted in the exploration log. + * It is to be used by exploration algorithms to keep track of important pieces + * of info specific to the algorithm. + * + * @param note + */ + void setNote(String key, String note); + String getNote(String key); + Map<String, String> getNotes(); void addCost(String costMetricName, String componentName, Double cost); diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/AbstractSolution.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/SolutionImpl.java similarity index 74% rename from bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/AbstractSolution.java rename to bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/SolutionImpl.java index 799f732c7e4386d02c788c3d59f48b871960e3bd..c8c63356996e07db3f479a828dd6683fafacb0ca 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/AbstractSolution.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/SolutionImpl.java @@ -3,6 +3,7 @@ package fr.irisa.cairn.gecos.typeexploration.model; import static fr.irisa.cairn.gecos.model.utils.misc.StreamUtils.join; import static fr.irisa.cairn.gecos.typeexploration.utils.SolutionSpaceUtils.printSymbol; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -12,26 +13,31 @@ import java.util.TreeMap; import fr.irisa.cairn.gecos.core.profiling.backend.ErrorStats; import gecos.core.Symbol; import typeexploration.SolutionSpace; +import typeexploration.TypeParam; /** * @author aelmouss */ -public abstract class AbstractSolution implements ISolution { +public class SolutionImpl implements ISolution { protected SolutionSpace solSpace; protected int id = -1; + protected Map<String, String> notes; protected Map<String, Map<String,Double>> costMap; protected Map<String, Double> accuracyMap; //! this should be optional protected Map<Symbol, List<ErrorStats>> errorStats; // <saved symbols, one ErrorStats per snapshot> - - public AbstractSolution(SolutionSpace solSpace) { + protected Map<Symbol, TypeParam> symbolBaseTypes; //! should not be publicly exposed since getType() handles automatic completion + + public SolutionImpl(SolutionSpace solSpace) { this.solSpace = solSpace; + this.notes = new TreeMap<>(); this.errorStats = new HashMap<>(); this.costMap = new TreeMap<>(); this.accuracyMap = new TreeMap<>(); + this.symbolBaseTypes = new HashMap<>(); } @Override @@ -44,6 +50,21 @@ public abstract class AbstractSolution implements ISolution { this.id = id; } + @Override + public void setNote(String key, String note) { + notes.put(key, note); + } + + @Override + public String getNote(String key) { + return notes.get(key); + } + + @Override + public Map<String, String> getNotes() { + return Collections.unmodifiableMap(notes); + } + @Override public SolutionSpace getSolutionSpace() { return solSpace; @@ -117,4 +138,21 @@ public abstract class AbstractSolution implements ISolution { return "Solution " + getID() + ":\n" + join(getSymbols().stream(), "\n", s -> "\tSymbol '" + printSymbol(s) + "' : " + getType(s)); } + + + @Override + public void setType(Symbol s, TypeParam t) { + symbolBaseTypes.put(s, t); + } + + @Override + public TypeParam getType(Symbol s) { + TypeParam t = symbolBaseTypes.get(s); + if(t == null) { + Symbol sameAs = solSpace.getAnalyzer().getSymbolsWithSame().get(s); + if(sameAs != null) + t = getType(sameAs); + } + return t; + } } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/UserFactory.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/UserFactory.java index 9d819c422ba86c1515858353c6f81bf0e1690d46..09834d20ec456db39af0690ae8c85bc59620ef12 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/UserFactory.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/model/UserFactory.java @@ -4,9 +4,10 @@ import static java.util.Collections.emptyList; import java.util.Collection; import java.util.Objects; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; import fr.irisa.cairn.gecos.model.utils.misc.StreamUtils; -import fr.irisa.cairn.gecos.typeexploration.dse.SolutionImpl; import gecos.core.Symbol; import gecos.types.OverflowMode; import gecos.types.QuantificationMode; @@ -27,101 +28,166 @@ import typeexploration.TypeexplorationFactory; * @author aelmouss */ public class UserFactory { - - private UserFactory() {} + + private UserFactory() { + } private static final TypeexplorationFactory factory = TypeexplorationFactory.eINSTANCE; - public static SolutionSpace emptySolutionSpace() { return factory.createSolutionSpace(); } - - public static FixedPointTypeConfiguration fixedConfiguration(Collection<Integer> totalWidthValues, Collection<Integer> integerWidthtValues) { + + public static FixedPointTypeConfiguration defaultFixedConfiguration(Collection<Integer> totalWidthValues, + Collection<Integer> integerWidthtValues, Collection<Integer> signValues) { + Objects.requireNonNull(totalWidthValues, "totalWidthValues cannot be null"); + Objects.requireNonNull(integerWidthtValues, "integerWidthtValues cannot be null"); + Objects.requireNonNull(signValues, "signValues cannot be null"); + if (totalWidthValues.isEmpty() || integerWidthtValues.isEmpty() || signValues.isEmpty()) { + throw new IllegalArgumentException("Default configuration should define all type attributes"); + } + return fixedConfiguration(null, totalWidthValues, integerWidthtValues, signValues); + } + + public static FixedPointTypeConfiguration fixedConfiguration(FixedPointTypeConfiguration defaultConfig, + Collection<Integer> totalWidthValues, Collection<Integer> integerWidthtValues, + Collection<Integer> signValues) { Objects.requireNonNull(totalWidthValues == null, "totalWidthValues cannot be null"); - + FixedPointTypeConfiguration c = factory.createFixedPointTypeConfiguration(); c.getTotalWidthValues().addAll(totalWidthValues); - if(integerWidthtValues != null ) + if (integerWidthtValues != null) c.getIntegerWidthValues().addAll(integerWidthtValues); - - //XXX + else { + if (defaultConfig == null) { + throw new NullPointerException(); + } else { + c.getIntegerWidthValues().addAll(defaultConfig.getIntegerWidthValues()); + } + } + if (signValues != null) + c.getSigned().addAll(signValues.stream().map(i -> i != 0).collect(Collectors.toList())); + else { + if (defaultConfig == null) { + throw new NullPointerException(); + } else { + c.getSigned().addAll(defaultConfig.getSigned()); + } + } + + // XXX c.getOverflowMode().add(OverflowMode.AC_WRAP); c.getQuantificationMode().add(QuantificationMode.AC_TRN); - + return c; } - public static FloatPointTypeConfiguration floatConfiguration(Collection<Integer> totalWidthValues, Collection<Integer> exponentWidthValues) { - Objects.requireNonNull(totalWidthValues == null, "totalWidthValues cannot be null"); - + public static FloatPointTypeConfiguration defaultFloatConfiguration(Collection<Integer> totalWidthValues, + Collection<Integer> exponentWidthValues, Collection<Integer> signValues) { + Objects.requireNonNull(totalWidthValues, "totalWidthValues cannot be null"); + Objects.requireNonNull(exponentWidthValues, "exponentWidthValues cannot be null"); + Objects.requireNonNull(signValues, "signValues cannot be null"); + if (totalWidthValues.isEmpty() || exponentWidthValues.isEmpty() || signValues.isEmpty()) { + throw new IllegalArgumentException("Default configuration should define all type attributes"); + } + return floatConfiguration(null, totalWidthValues, exponentWidthValues, signValues); + } + + public static FloatPointTypeConfiguration floatConfiguration(FloatPointTypeConfiguration defaultConfig, + Collection<Integer> totalWidthValues, Collection<Integer> exponentWidthValues, + Collection<Integer> signValues) { + Objects.requireNonNull(totalWidthValues, "totalWidthValues cannot be null"); + FloatPointTypeConfiguration c = factory.createFloatPointTypeConfiguration(); c.getTotalWidthValues().addAll(totalWidthValues); - if(exponentWidthValues != null) + if (exponentWidthValues != null) c.getExponentWidthValues().addAll(exponentWidthValues); + else { + if (defaultConfig == null) { + throw new NullPointerException(); + } else { + c.getExponentWidthValues().addAll(defaultConfig.getExponentWidthValues()); + } + } + if (signValues != null) + c.getSigned().addAll(signValues.stream().map(i -> i != 0).collect(Collectors.toList())); + else { + if (defaultConfig == null) { + throw new NullPointerException(); + } else { + c.getSigned().addAll(defaultConfig.getSigned()); + } + } return c; } - + public static SameTypeConstraint sameTypeConstraint(Symbol asSymbol) { Objects.requireNonNull(asSymbol); - + SameTypeConstraint c = factory.createSameTypeConstraint(); c.setSymbol(asSymbol); return c; } - public static TypeConfigurationSpace configurationSpace(FixedPointTypeConfiguration fixedPtConfig, FloatPointTypeConfiguration floatPtConfig, Collection<TypeConstraint> constraints) { + public static TypeConfigurationSpace configurationSpace(FixedPointTypeConfiguration fixedPtConfig, + FloatPointTypeConfiguration floatPtConfig, Collection<TypeConstraint> constraints) { Objects.requireNonNull(constraints); TypeConfigurationSpace c = factory.createTypeConfigurationSpace(); c.getConstraints().addAll(constraints); - if(fixedPtConfig != null) + if (fixedPtConfig != null) c.setFixedPtCongurations(fixedPtConfig); - if(floatPtConfig != null) + if (floatPtConfig != null) c.setFloatPtCongurations(floatPtConfig); - + return c; } - - public static TypeConfigurationSpace configurationSpace(Collection<TypeConfiguration> configs, Collection<TypeConstraint> constraints) { - FixedPointTypeConfiguration fixedPtConfig = StreamUtils.filterByType(configs.stream(), FixedPointTypeConfiguration.class) - .reduce((c1,c2) -> c1.mergeIn(c2)).orElse(null); - FloatPointTypeConfiguration floatPtConfig = StreamUtils.filterByType(configs.stream(), FloatPointTypeConfiguration.class) - .reduce((c1,c2) -> c1.mergeIn(c2)).orElse(null); - + + public static TypeConfigurationSpace configurationSpace(Collection<TypeConfiguration> configs, + Collection<TypeConstraint> constraints) { + FixedPointTypeConfiguration fixedPtConfig = StreamUtils + .filterByType(configs.stream(), FixedPointTypeConfiguration.class).reduce((c1, c2) -> c1.mergeIn(c2)) + .orElse(null); + FloatPointTypeConfiguration floatPtConfig = StreamUtils + .filterByType(configs.stream(), FloatPointTypeConfiguration.class).reduce((c1, c2) -> c1.mergeIn(c2)) + .orElse(null); + return configurationSpace(fixedPtConfig, floatPtConfig, constraints); } - + public static TypeConfigurationSpace configurationSpace(Collection<TypeConfiguration> configs) { return configurationSpace(configs, emptyList()); } - - public static FixedPointTypeParam fixedTypeParam(int w, int i, QuantificationMode q, OverflowMode o) { + + public static FixedPointTypeParam fixedTypeParam(int w, int i, boolean signed, QuantificationMode q, + OverflowMode o) { FixedPointTypeParam t = factory.createFixedPointTypeParam(); t.setTotalWidth(w); t.setIntegerWidth(i); + t.setSigned(signed); t.setQuantificationMode(q); t.setOverflowMode(o); return t; } - - public static FloatPointTypeParam floatTypeParam(int w, int e) { + + public static FloatPointTypeParam floatTypeParam(int w, int e, boolean signed) { FloatPointTypeParam t = factory.createFloatPointTypeParam(); t.setTotalWidth(w); t.setExponentWidth(e); + t.setSigned(signed); return t; } - + public static GenericTypeParam genericTypeParam(Type type) { GenericTypeParam t = factory.createGenericTypeParam(); t.setType(type); return t; } - private static int solId = 0; + private static AtomicInteger solId = new AtomicInteger(0); public static ISolution solution(SolutionSpace solSpace) { ISolution sol = new SolutionImpl(solSpace); - sol.setID(solId++); + sol.setID(solId.incrementAndGet()); return sol; } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/solutionspace/AbstractSolutionSpaceBuilder.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/solutionspace/AbstractSolutionSpaceBuilder.java index 2f02a020f9643c47dbb25def2dd213c19ad534f4..c35f8c673fbf49ebbab932c64a5bc4831603bf61 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/solutionspace/AbstractSolutionSpaceBuilder.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/solutionspace/AbstractSolutionSpaceBuilder.java @@ -2,8 +2,6 @@ package fr.irisa.cairn.gecos.typeexploration.solutionspace; import static fr.irisa.cairn.gecos.model.factory.GecosUserAnnotationFactory.CODEGEN_IGNORE_ANNOTATION; import static fr.irisa.cairn.gecos.model.utils.annotations.PragmaUtils.findPragmaContent; -import static java.util.Arrays.asList; -import static java.util.Collections.singletonList; import java.util.List; @@ -54,8 +52,11 @@ public abstract class AbstractSolutionSpaceBuilder implements ISolutionSpaceBuil } protected void buildSymbolsTypeConfigurations(ProcedureSet ps) { - solSpace.setDefaultTypeConfigs(UserFactory.configurationSpace( - defaultTypeConfigs == null ? createDefaultConfigs() : defaultTypeConfigs)); + if (defaultTypeConfigs == null) { + throw new NullPointerException(); + } else { + solSpace.setDefaultTypeConfigs(UserFactory.configurationSpace(defaultTypeConfigs)); + } EMFUtils.eAllContentsInstancesOf(ps, Symbol.class).stream() .filter(this::filterType) @@ -90,11 +91,6 @@ public abstract class AbstractSolutionSpaceBuilder implements ISolutionSpaceBuil return t.getBaseLevel().isFloat(); } - protected List<TypeConfiguration> createDefaultConfigs() { - return asList(UserFactory.fixedConfiguration(singletonList(32), singletonList(16)), - UserFactory.floatConfiguration(singletonList(32), singletonList(8))); - } - /** * Should return true if the specified {@link Symbol} has custom type configurations. * In which case {@link #extractTypeConfigurations(Symbol)} will be invoked to extract them. diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/solutionspace/SolutionSpaceBuilderFromPragma.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/solutionspace/SolutionSpaceBuilderFromPragma.java index 9ee039bdb54908003d1b2c3be08887404b905b25..1b194e5b1e9ebf7580976282e8f40b6eedd26cf8 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/solutionspace/SolutionSpaceBuilderFromPragma.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/solutionspace/SolutionSpaceBuilderFromPragma.java @@ -2,6 +2,7 @@ package fr.irisa.cairn.gecos.typeexploration.solutionspace; import static fr.irisa.cairn.gecos.model.utils.annotations.PragmaUtils.findPragmaContent; import static fr.irisa.cairn.gecos.model.utils.annotations.PragmaUtils.getPragmaName; +import static java.util.Collections.singletonList; import java.util.ArrayList; import java.util.List; @@ -14,6 +15,7 @@ import gecos.annotations.FileLocationAnnotation; import gecos.core.Symbol; import typeexploration.FixedPointTypeConfiguration; import typeexploration.FloatPointTypeConfiguration; +import typeexploration.SolutionSpace; import typeexploration.TypeConfiguration; import typeexploration.TypeConfigurationSpace; import typeexploration.TypeConstraint; @@ -31,172 +33,186 @@ public class SolutionSpaceBuilderFromPragma extends AbstractSolutionSpaceBuilder protected boolean hasCustomTypeConfigs(Symbol s) { return PragmaExploreParser.fastHasPragmaExplore(s); } - + @Override protected TypeConfigurationSpace createConfigurationSpace(Symbol s) { - PragmaExploreParser parser = new PragmaExploreParser(); + PragmaExploreParser parser = new PragmaExploreParser(getSolutionSpace()); parser.parsePragmaExplore(s); return UserFactory.configurationSpace(parser.configs, parser.constraints); } - - - //! It's probably a good idea to define a proper grammar if this keeps on growing .. + // ! It's probably a good idea to define a proper grammar if this keeps on + // growing .. public static class PragmaExploreParser { // Explore FIX private static final String PRAGMA_EXPLORE_FIX_NAME = "EXPLORE_FIX"; - private static final Pattern PRAGMA_EXPLORE_FIX_ARG_PATTERN = Pattern.compile("(W|I)\\s*=\\s*\\{([^WI]*)\\}"); - private static final Pattern PRAGMA_EXPLORE_FIX_PATTERN = Pattern.compile( - "^\\s*"+PRAGMA_EXPLORE_FIX_NAME+"\\s+(" + PRAGMA_EXPLORE_FIX_ARG_PATTERN + "\\s*)+"); + private static final Pattern PRAGMA_EXPLORE_FIX_ARG_PATTERN = Pattern + .compile("(W|I|S)\\s*=\\s*\\{([^WIS]*)\\}"); + private static final Pattern PRAGMA_EXPLORE_FIX_PATTERN = Pattern + .compile("^\\s*" + PRAGMA_EXPLORE_FIX_NAME + "\\s+(" + PRAGMA_EXPLORE_FIX_ARG_PATTERN + "\\s*)+"); // Explore Float private static final String PRAGMA_EXPLORE_FLOAT_NAME = "EXPLORE_FLOAT"; - private static final Pattern PRAGMA_EXPLORE_FLOAT_ARG_PATTERN = Pattern.compile("(W|E)\\s*=\\s*\\{([^WE]*)\\}"); - private static final Pattern PRAGMA_EXPLORE_FLOAT_PATTERN = Pattern.compile( - "^\\s*"+PRAGMA_EXPLORE_FLOAT_NAME+"\\s+(" + PRAGMA_EXPLORE_FLOAT_ARG_PATTERN + "\\s*)+"); - + private static final Pattern PRAGMA_EXPLORE_FLOAT_ARG_PATTERN = Pattern + .compile("(W|E|S)\\s*=\\s*\\{([^WES]*)\\}"); + private static final Pattern PRAGMA_EXPLORE_FLOAT_PATTERN = Pattern + .compile("^\\s*" + PRAGMA_EXPLORE_FLOAT_NAME + "\\s+(" + PRAGMA_EXPLORE_FLOAT_ARG_PATTERN + "\\s*)+"); + // Explore Contraint private static final String PRAGMA_EXPLORE_CONSTRAINT_NAME = "EXPLORE_CONSTRAINT"; private static final Pattern PRAGMA_EXPLORE_CONSTRAINT_ARG_PATTERN = Pattern.compile("(SAME)\\s*=\\s*(\\w+)"); - private static final Pattern PRAGMA_EXPLORE_CONSTRAINT_PATTERN = Pattern.compile( - "^\\s*"+PRAGMA_EXPLORE_CONSTRAINT_NAME+"\\s+" + PRAGMA_EXPLORE_CONSTRAINT_ARG_PATTERN); - + private static final Pattern PRAGMA_EXPLORE_CONSTRAINT_PATTERN = Pattern + .compile("^\\s*" + PRAGMA_EXPLORE_CONSTRAINT_NAME + "\\s+" + PRAGMA_EXPLORE_CONSTRAINT_ARG_PATTERN); + // Set values separators - private static final String SET_VALUES_SEPARATOR = ","; - private static final String RANGE_VALUES_SEPARATOR = "\\.\\."; - + private static final String SET_VALUES_SEPARATOR = ","; + private static final String RANGE_VALUES_SEPARATOR = "\\.\\."; + // error msg - private static final String PRAGMA_EXPLORE_FIX_USAGE_MSG = "#pragma EXPLORE_FIX [(W|I)={[(MIN..MAX)|(VAL),]*}]+"; - private static final String PRAGMA_EXPLORE_FLOAT_USAGE_MSG = "#pragma EXPLORE_FLOAT [(W|E)={[(MIN..MAX)|(VAL),]*}]+"; + private static final String PRAGMA_EXPLORE_FIX_USAGE_MSG = "#pragma EXPLORE_FIX [(W|I|S)={[(MIN..MAX)|(VAL),]*}]+"; + private static final String PRAGMA_EXPLORE_FLOAT_USAGE_MSG = "#pragma EXPLORE_FLOAT [(W|E|S)={[(MIN..MAX)|(VAL),]*}]+"; private static final String PRAGMA_EXPLORE_CONSTRAINT_USAGE_MSG = "#pragma EXPLORE_CONSTRAINT SAME=<symbol_name>"; - - + private List<TypeConfiguration> configs; private List<TypeConstraint> constraints; - + private SolutionSpace solutionSpace; + + public PragmaExploreParser(SolutionSpace solutionSpace) { + this.solutionSpace = solutionSpace; + } + public void parsePragmaExplore(Symbol s) { this.configs = new ArrayList<>(); this.constraints = new ArrayList<>(); - - for(String content : s.getPragma().getContent()) { - if(isPragmaExploreFix(content)) { + + for (String content : s.getPragma().getContent()) { + if (isPragmaExploreFix(content)) { try { - configs.add(parsePragmaExploreFix(content)); - } catch(PragmaSyntaxError e) { + configs.add(parsePragmaExploreFix(content, + solutionSpace.getDefaultTypeConfigs().getFixedPtCongurations())); + } catch (PragmaSyntaxError e) { throw invalidPragmaExploreSyntax(PRAGMA_EXPLORE_FIX_NAME, s, e); } - } else if(isPragmaExploreFloat(content)) { + } else if (isPragmaExploreFloat(content)) { try { - configs.add(parsePragmaExploreFloat(content)); - } catch(PragmaSyntaxError e) { + configs.add(parsePragmaExploreFloat(content, + solutionSpace.getDefaultTypeConfigs().getFloatPtCongurations())); + } catch (PragmaSyntaxError e) { throw invalidPragmaExploreSyntax(PRAGMA_EXPLORE_FLOAT_NAME, s, e); } - } else if(isPragmaExploreConstraint(content)) { + } else if (isPragmaExploreConstraint(content)) { try { constraints.add(parsePragmaExploreConstraint(content, s)); - } catch(PragmaSyntaxError e) { + } catch (PragmaSyntaxError e) { throw invalidPragmaExploreSyntax(PRAGMA_EXPLORE_CONSTRAINT_NAME, s, e); } } } } - - + private static boolean fastHasPragmaExplore(Symbol s) { - return findPragmaContent(s, c -> getPragmaName(c).toUpperCase() - .matches("("+PRAGMA_EXPLORE_FIX_NAME + ")|("+PRAGMA_EXPLORE_FLOAT_NAME+")|("+PRAGMA_EXPLORE_CONSTRAINT_NAME+")")) - .findAny().isPresent(); + return findPragmaContent(s, + c -> getPragmaName(c).toUpperCase().matches("(" + PRAGMA_EXPLORE_FIX_NAME + ")|(" + + PRAGMA_EXPLORE_FLOAT_NAME + ")|(" + PRAGMA_EXPLORE_CONSTRAINT_NAME + ")")).findAny() + .isPresent(); } - + private static boolean isPragmaExploreFix(String pragmaContent) { return PRAGMA_EXPLORE_FIX_PATTERN.matcher(pragmaContent.toUpperCase()).matches(); } - + private static boolean isPragmaExploreFloat(String pragmaContent) { return PRAGMA_EXPLORE_FLOAT_PATTERN.matcher(pragmaContent.toUpperCase()).matches(); } - + private static boolean isPragmaExploreConstraint(String pragmaContent) { return PRAGMA_EXPLORE_CONSTRAINT_PATTERN.matcher(pragmaContent.toUpperCase()).matches(); } - + private static TypeConstraint parsePragmaExploreConstraint(String pragmaContent, Symbol s) { Matcher matcher = PRAGMA_EXPLORE_CONSTRAINT_ARG_PATTERN.matcher(pragmaContent); - - if(matcher.find()) { - assert(matcher.groupCount() == 2); + + if (matcher.find()) { + assert (matcher.groupCount() == 2); String param = matcher.group(1); String value = matcher.group(2); - + if (param.equals("SAME")) { Symbol asSymbol = s.getContainingScope().lookup(value); - if(asSymbol == null) + if (asSymbol == null) throw new PragmaSyntaxError("Symbol not found '" + value + "'"); return UserFactory.sameTypeConstraint(asSymbol); } else throw new PragmaSyntaxError("invalid constraint '" + param + "'"); } - + throw new PragmaSyntaxError("invalid type constraint '" + pragmaContent + "'"); } - - private static FixedPointTypeConfiguration parsePragmaExploreFix(String pragmaContent) { + + private static FixedPointTypeConfiguration parsePragmaExploreFix(String pragmaContent, + FixedPointTypeConfiguration fixedPointTypeConfiguration) { Matcher matcher = PRAGMA_EXPLORE_FIX_ARG_PATTERN.matcher(pragmaContent); - + List<Integer> iValues = null; List<Integer> wValues = null; - while(matcher.find()) { - assert(matcher.groupCount() == 2); + List<Integer> sValues = null; + while (matcher.find()) { + assert (matcher.groupCount() == 2); String param = matcher.group(1); String setValue = matcher.group(2); - List<Integer> values = parseSetValue(setValue); - + if (param.equals("W")) - wValues = values; + wValues = parseSetValue(setValue); else if (param.equals("I")) - iValues = values; + iValues = parseSetValue(setValue); + else if (param.equals("S")) + sValues = parseSetValue(setValue); else throw new PragmaSyntaxError("invalid parameter name '" + param + "'"); } - if(iValues == null && wValues == null) + if (iValues == null && wValues == null && sValues == null) throw new PragmaSyntaxError(); - - return UserFactory.fixedConfiguration(wValues, iValues); + + return UserFactory.fixedConfiguration(fixedPointTypeConfiguration, wValues, iValues, sValues); } - private static FloatPointTypeConfiguration parsePragmaExploreFloat(String pragmaContent) { + private static FloatPointTypeConfiguration parsePragmaExploreFloat(String pragmaContent, + FloatPointTypeConfiguration floatPointTypeConfiguration) { Matcher matcher = PRAGMA_EXPLORE_FLOAT_ARG_PATTERN.matcher(pragmaContent); - + List<Integer> eValues = null; List<Integer> wValues = null; - while(matcher.find()) { - assert(matcher.groupCount() == 2); + List<Integer> sValues = null; + while (matcher.find()) { + assert (matcher.groupCount() == 2); String param = matcher.group(1); String setValue = matcher.group(2); List<Integer> values = parseSetValue(setValue); - + if (param.equals("W")) wValues = values; else if (param.equals("E")) eValues = values; + else if (param.equals("S")) + sValues = parseSetValue(setValue); else throw new PragmaSyntaxError("invalid parameter name '" + param + "'"); } - if(eValues == null && wValues == null) + if (eValues == null && wValues == null && sValues == null) throw new PragmaSyntaxError(); - - return UserFactory.floatConfiguration(wValues, eValues); + + return UserFactory.floatConfiguration(floatPointTypeConfiguration, wValues, eValues, sValues); } - + public static List<Integer> parseSetValue(String setValue) { List<Integer> set = new ArrayList<>(); - for(String v : setValue.split(SET_VALUES_SEPARATOR)) { + for (String v : setValue.split(SET_VALUES_SEPARATOR)) { String[] range = v.split(RANGE_VALUES_SEPARATOR); int first = Integer.parseInt(range[0].trim()); - if(range.length == 1) { + if (range.length == 1) { set.add(first); - } else if(range.length == 2) { + } else if (range.length == 2) { int last = Integer.parseInt(range[1].trim()); IntStream.rangeClosed(first, last).forEach(set::add); } else @@ -204,38 +220,39 @@ public class SolutionSpaceBuilderFromPragma extends AbstractSolutionSpaceBuilder } return set; } - + private static PragmaSyntaxError invalidPragmaExploreSyntax(String pragmaName, Symbol s, Exception cause) { FileLocationAnnotation loc = s.getFileLocation(); String msg = "Invalid pragma EXPLORE syntax on : " + s; - if(loc != null) + if (loc != null) msg += " (at " + loc.getFilename() + ":" + loc.getStartingLine() + ")"; msg += "\n"; - + switch (pragmaName) { case PRAGMA_EXPLORE_FIX_NAME: - msg += PRAGMA_EXPLORE_FIX_USAGE_MSG; break; + msg += PRAGMA_EXPLORE_FIX_USAGE_MSG; + break; case PRAGMA_EXPLORE_FLOAT_NAME: - msg += PRAGMA_EXPLORE_FLOAT_USAGE_MSG; break; + msg += PRAGMA_EXPLORE_FLOAT_USAGE_MSG; + break; case PRAGMA_EXPLORE_CONSTRAINT_NAME: - msg += PRAGMA_EXPLORE_CONSTRAINT_USAGE_MSG; break; + msg += PRAGMA_EXPLORE_CONSTRAINT_USAGE_MSG; + break; default: break; } - - if(cause == null) + + if (cause == null) return new PragmaSyntaxError(msg); return new PragmaSyntaxError(msg, cause); } - + } - - -/* ********************************** - * Tests - * **********************************/ - + /* + * ********************************** Tests + **********************************/ + public static void main(String[] args) { String[] tests = new String[] { "EXPLORE_FIX W={10..20, 32} I = { 4 , 5}", @@ -245,20 +262,21 @@ public class SolutionSpaceBuilderFromPragma extends AbstractSolutionSpaceBuilder "EXPLORE_FLOAT W={10..20, 32} E = { 4 , 5}", "EXPLORE_FLOAT E={10..20,32} W={4,5}", "EXPLORE_FLOAT W={10..20, 32}", + "EXPLORE_FLOAT S={0..1} W={10..20, 32}", }; for(String s : tests) { System.out.println(s); if(PragmaExploreParser.isPragmaExploreFix(s)) { - TypeConfiguration config = PragmaExploreParser.parsePragmaExploreFix(s); + TypeConfiguration config = PragmaExploreParser.parsePragmaExploreFix(s, UserFactory.defaultFixedConfiguration(singletonList(32), singletonList(16),singletonList(1))); System.out.println(" " + config); } else if(PragmaExploreParser.isPragmaExploreFloat(s)) { - TypeConfiguration config = PragmaExploreParser.parsePragmaExploreFloat(s); + TypeConfiguration config = PragmaExploreParser.parsePragmaExploreFloat(s, UserFactory.defaultFloatConfiguration(singletonList(32), singletonList(8),singletonList(1))); System.out.println(" " + config); } else System.out.println(" NO MATCH"); } } - + } diff --git a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/utils/SolutionSpaceUtils.java b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/utils/SolutionSpaceUtils.java index 777027419d166b83c1cf10cacafed46d085cfa72..994210843d136b3ff54bdbe4317b223a16931de1 100644 --- a/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/utils/SolutionSpaceUtils.java +++ b/bundles/fr.irisa.cairn.gecos.typeexploration/src/fr/irisa/cairn/gecos/typeexploration/utils/SolutionSpaceUtils.java @@ -44,7 +44,8 @@ public class SolutionSpaceUtils { for(QuantificationMode q : c.getQuantificationMode()) for(int i : c.getIntegerWidthValues()) for(int w : c.getTotalWidthValues()) - builder.add(UserFactory.fixedTypeParam(w, i, q, o)); + for (boolean sign : c.getSigned()) + builder.add(UserFactory.fixedTypeParam(w, i, sign, q, o)); return builder.build(); } @@ -53,7 +54,8 @@ public class SolutionSpaceUtils { Stream.Builder<FloatPointTypeParam> builder = Stream.builder(); for(int e : c.getExponentWidthValues()) for(int w : c.getTotalWidthValues()) - builder.add(UserFactory.floatTypeParam(w, e)); + for (boolean s : c.getSigned()) + builder.add(UserFactory.floatTypeParam(w, e, s)); return builder.build(); } diff --git a/pom.xml b/pom.xml index ff901e24090969bd8c6f39af8ad6214d58f643eb..0ab0691be95f18980645cf152104d9f4eb2d46b3 100644 --- a/pom.xml +++ b/pom.xml @@ -29,5 +29,5 @@ <module>features</module> <module>releng</module> </modules> - + </project> diff --git a/releng/fr.irisa.cairn.gecos.float2fix.target/fr.irisa.cairn.gecos.float2fix.target.target b/releng/fr.irisa.cairn.gecos.float2fix.target/fr.irisa.cairn.gecos.float2fix.target.target index 294e8a6ed9e4863559e2fc3718459a03ad102705..50ee057fee6d81342f4f6eaa6b0dd6183d0f87fa 100644 --- a/releng/fr.irisa.cairn.gecos.float2fix.target/fr.irisa.cairn.gecos.float2fix.target.target +++ b/releng/fr.irisa.cairn.gecos.float2fix.target/fr.irisa.cairn.gecos.float2fix.target.target @@ -16,8 +16,8 @@ <repository location="http://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.14.0/"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> -<unit id="fr.irisa.cairn.gecos.core.feature.feature.group" range="[0.7.0, 1.0.0)"/> -<repository location="http://gecos.gforge.inria.fr/updatesite/gecos/core/snapshot/20180622173019/"/> +<unit id="fr.irisa.cairn.gecos.core.feature.feature.group" range="[0.9.2, 1.0.0)"/> +<repository location="http://gecos.gforge.inria.fr/updatesite/gecos/core/release/v0.9.2/"/> </location> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <unit id="fr.irisa.cairn.gecos.tools.emf.feature.feature.group" range="[1.0.1, 2.0.0)"/>