/* Initialize the evaluation callbacks and process the tree structure
* to conform to the expectations of the callback functions. */
/* Also, initialize and allocate the compiler data structure */
+ // TODO: Processing the tree in reverse root order would be better,
+ // as it would make dependency handling easier (all subexpression
+ // references would be processed before the actual subexpression) and
+ // could remove the need for most of these extra loops.
item = sc->root;
while (item)
{
optimize_arithmetic_expressions(item);
/* Initialize the compiler data */
init_item_compilerdata(item);
+ item = item->next;
+ }
+ // Initialize the static evaluation compiler flags.
+ // Requires the FULLEVAL compiler flag for the whole tree.
+ item = sc->root;
+ while (item)
+ {
init_item_staticeval(item);
init_item_subexpr_refcount(item);
item = item->next;
--- /dev/null
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+ <ParsedSelections Name="Parsed">
+ <ParsedVariable Name="Variable1">
+ <String Name="Input">foo = atomnr 1 to 8 and x < 10</String>
+ </ParsedVariable>
+ <ParsedSelection Name="Selection1">
+ <String Name="Input">atomnr 1 to 5 and y < 10 and foo</String>
+ <String Name="Name">atomnr 1 to 5 and y < 10 and foo</String>
+ <String Name="Text">atomnr 1 to 5 and y < 10 and foo</String>
+ <Bool Name="Dynamic">true</Bool>
+ </ParsedSelection>
+ <ParsedSelection Name="Selection2">
+ <String Name="Input">foo</String>
+ <String Name="Name">foo</String>
+ <String Name="Text">foo</String>
+ <Bool Name="Dynamic">true</Bool>
+ </ParsedSelection>
+ </ParsedSelections>
+ <CompiledSelections Name="Compiled">
+ <Selection Name="Selection1">
+ <Sequence Name="Atoms">
+ <Int Name="Length">5</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection2">
+ <Sequence Name="Atoms">
+ <Int Name="Length">8</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ </Sequence>
+ </Selection>
+ </CompiledSelections>
+ <EvaluatedSelections Name="Frame1">
+ <Selection Name="Selection1">
+ <Sequence Name="Atoms">
+ <Int Name="Length">5</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ </Sequence>
+ </Selection>
+ <Selection Name="Selection2">
+ <Sequence Name="Atoms">
+ <Int Name="Length">8</Int>
+ <Int>0</Int>
+ <Int>1</Int>
+ <Int>2</Int>
+ <Int>3</Int>
+ <Int>4</Int>
+ <Int>5</Int>
+ <Int>6</Int>
+ <Int>7</Int>
+ </Sequence>
+ </Selection>
+ </EvaluatedSelections>
+</ReferenceData>
}
+TEST_F(SelectionCollectionDataTest, HandlesVariablesWithMixedEvaluationGroups2)
+{
+ static const char * const selections[] = {
+ "foo = atomnr 1 to 8 and x < 10",
+ "atomnr 1 to 5 and y < 10 and foo",
+ "foo"
+ };
+ setFlags(TestFlags() | efTestEvaluation);
+ runTest("simple.gro", selections);
+}
+
+
} // namespace