Browse Source

teil des conflict detection algorithmusses umgesetzt

Kolja Strohm 6 years ago
parent
commit
8af11e6666

+ 1 - 0
src/animation/ControlFlow.java

@@ -16,6 +16,7 @@ public class ControlFlow {
     public ControlFlow( PseudoCodeNode functionNode )
     {
     	status = CALL;
+    	function = functionNode;
     }
     
     public PseudoCodeNode getFunction()

+ 12 - 2
src/animation/Memory.java

@@ -31,7 +31,11 @@ public class Memory {
         if( global )
             this.global.declare( name, value );
         else
+        {
+        	if( stack.size() == 0 )
+        		return;
             stack.peek().declare( name, value );
+        }
     }
     
     public <T> void write( String name, T value, boolean global )
@@ -64,7 +68,7 @@ public class Memory {
         	while (iterator.hasNext()) {
         	   StackFrame stackF = iterator.next();
         	   if( stackF.isDefined( name ) )
-        		   stackF.get( name );
+        		   return stackF.get( name );
         	   if( stackF.getType() == FrameType.FUNCTION )
         		   break;
         	}
@@ -91,7 +95,9 @@ public class Memory {
     {
     	if( global )
     		return this.global.isDefined( name );
-    	return stack.peek().get( name );
+    	if( stack.size() == 0 )
+    		return false;
+    	return stack.peek().isDefined( name );
     }
     
     public void undeclare( String name, boolean global )
@@ -99,6 +105,10 @@ public class Memory {
         if( global )
             this.global.undeclare( name );
         else
+        {
+        	if( stack.size() == 0 )
+        		return;
             stack.peek().undeclare( name );
+        }
     }
 }

+ 33 - 12
src/bk/BKNodePlacement.java

@@ -9,6 +9,9 @@ import animation.CodeLine;
 import animation.ControlFlow;
 import animation.Memory;
 import animation.PseudoCodeNode;
+import animation.StackFrame;
+import animation.StackFrame.FrameType;
+import codelines.FunctionDefinition;
 import graph.LayeredGraphNode;
 import lib.TextLayoutHelper;
 
@@ -58,27 +61,36 @@ public class BKNodePlacement extends AnimatedAlgorithm {
     @Override
     public PseudoCodeNode createPseudocodeTree( JTree tree )
     {
+    	String[] vars = { "graph" };
+    	PseudoCodeNode mainFunction = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode("function bkNodePlacement( graph )", vars ), tree, new FunctionDefinition( new String[]{"graph"} ), this );
     	root = new PseudoCodeNode( TextLayoutHelper.setupPseudoCodeStage("BK Node Placement Algorithm" ), tree, new CodeLine() {
 
 			@Override
 			public ControlFlow runForward(Memory m) {
-				return new ControlFlow( ControlFlow.STEP_INTO );
+				if( !m.isDefined( "line_" + lineId + "_call", false ) )
+				{
+					m.declare( "line_" + lineId + "_call", true, false );
+					m.declare( "param1", graph, true );
+					actions.push( (Memory mem) -> {
+						mem.undeclare( "param1", true );
+						mem.undeclare( "line_" + lineId + "_call", false );
+						return new ControlFlow( ControlFlow.STEP_OVER );
+					} );
+					return new ControlFlow( mainFunction );
+				}
+				else
+				{
+					actions.push( (Memory mem) -> {
+						return new ControlFlow( mainFunction );
+					} );
+					return new ControlFlow( ControlFlow.STEP_OVER );
+				}
 			}
         	
         }, this );
         root.setSelected( true );
-    	String[] vars = { "graph" };
-    	PseudoCodeNode mainFunction = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode("function bkNodePlacement( graph )", vars ), tree, new CodeLine() {
-
-			@Override
-			public ControlFlow runForward(Memory m) {
-				return new ControlFlow( ControlFlow.STEP_INTO );
-			}
-        	
-        }, this );
     	
         PseudoCodeNode conflictDetectionFunction = conftion.createPseudocodeTree( tree );
-        
         PseudoCodeNode node1 = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "call detectConflicts( graph )", vars ), tree, new CodeLine() {
 
 			@Override
@@ -86,11 +98,19 @@ public class BKNodePlacement extends AnimatedAlgorithm {
 				if( !m.isDefined( "line_" + lineId + "_call", false ) )
 				{
 					m.declare( "line_" + lineId + "_call", true, false );
+					m.declare( "param1", m.read( "graph", false ), true );
+					actions.push( (Memory mem) -> {
+						mem.undeclare( "param1", true );
+						mem.undeclare( "line_" + lineId + "_call", false );
+						return new ControlFlow( ControlFlow.STEP_OVER );
+					} );
 					return new ControlFlow( conflictDetectionFunction );
 				}
 				else
 				{
-					m.undeclare( "line_" + lineId + "_call", false );
+					actions.push( (Memory mem) -> {
+						return new ControlFlow( conflictDetectionFunction );
+					} );
 					return new ControlFlow( ControlFlow.STEP_OVER );
 				}
 			}
@@ -99,6 +119,7 @@ public class BKNodePlacement extends AnimatedAlgorithm {
         root.add( mainFunction );
         mainFunction.add( node1 );
         root.add( conflictDetectionFunction );
+        this.addActiveFunction( root );
         return root;
     }
 

+ 78 - 27
src/bk/ConflictDetection.java

@@ -12,6 +12,11 @@ import animation.ControlFlow;
 import animation.Memory;
 import animation.PseudoCodeNode;
 import animation.PseudoCodeNode.CodeAction;
+import animation.StackFrame;
+import animation.StackFrame.FrameType;
+import codelines.DeclareVariable;
+import codelines.ForLoop;
+import codelines.FunctionDefinition;
 import graph.LayeredGraphEdge;
 import graph.LayeredGraphNode;
 import lib.TextLayoutHelper;
@@ -35,46 +40,82 @@ public class ConflictDetection implements AlgorithmStage {
     @Override
     public PseudoCodeNode createPseudocodeTree(JTree tree) {
         String vars[] = { "i", "L", "k0", "l", "l1", "k1", "k", "v", "graph" };
-        PseudoCodeNode root = new PseudoCodeNode(TextLayoutHelper.setupPseudoCode("mark_conflicts( graph )", vars), tree, new CodeLine() {
-
+        String params[] = { "graph" };
+        PseudoCodeNode root = new PseudoCodeNode(TextLayoutHelper.setupPseudoCode("function mark_conflicts( graph )", vars), tree, new FunctionDefinition( params ), alg );
+        PseudoCodeNode init = new PseudoCodeNode(TextLayoutHelper.setupPseudoCode( "L = graph.getContainedLayers();", vars), tree, new CodeLine() {
 			@Override
 			public ControlFlow runForward(Memory m) {
-				if( !m.isDefined( "param1", true ) )
+				m.declare( "L", m.<LayeredGraphNode>read( "graph", false ).getContainedLayers(), false );
+				m.declare( "L.length-2", m.<LayeredGraphNode>read( "graph", false ).getContainedLayers().size() - 2, false );
+				m.declare( "1", 1, false );
+				actions.push( (Memory mem) -> {
+					mem.undeclare( "L", false );
+					mem.undeclare( "L.length-2", false );
+					mem.undeclare( "1", false );
 					return new ControlFlow( ControlFlow.STEP_OVER );
-				//m.addFrame();
-				LayeredGraphNode param = m.<LayeredGraphNode>read( "param1", true );
-				m.undeclare( "param1", true );
-				m.declare( "graph", param, false );
-				m.declare( "Layers", param.getContainedLayers(), false );
-				return new ControlFlow( ControlFlow.STEP_INTO );
+				} );
+				return new ControlFlow( ControlFlow.STEP_OVER );
 			}
         }, alg );
-        PseudoCodeNode[] lines = new PseudoCodeNode[16];
-        lines[ 0 ] = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "for i=1 to |L|-2 do", vars ), tree, new CodeLine() {
-
+        root.add( init );
+        PseudoCodeNode outerLoop = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "for i=1 to |L|-2 do", vars ), tree, new ForLoop( "i", "1", "L.length-2" ), alg );
+        root.add( outerLoop );
+        PseudoCodeNode line = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "k0 = 0; l = 0;", vars ), tree, new CodeLine() {
 			@Override
 			public ControlFlow runForward(Memory m) {
-				// TODO Auto-generated method stub
-				return null;
+				m.declare( "k0", 0, false );
+				m.declare( "l", 0, false );
+				m.declare( "end_", m.<LayeredGraphNode>read( "graph", false ).getContainedLayers().get( m.<Integer>read( "i", false ) + 1 ).size() - 1, false );
+				m.declare( "0", 0, false );
+				actions.push( (Memory mem) -> {
+					mem.undeclare( "k0", false );
+					mem.undeclare( "l", false );
+					mem.undeclare( "end_", false );
+					mem.undeclare( "0", false );
+					return new ControlFlow( ControlFlow.STEP_OVER );
+				} );
+				return new ControlFlow( ControlFlow.STEP_OVER );
 			}
-        	
         }, alg );
-        root.add( lines[ 0 ] );
-        lines[ 1 ] = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "k0 = 0; l = 0;", vars ), tree, new CodeLine() {
-
+        outerLoop.add( line );
+        PseudoCodeNode innerLoop = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "for l1=0 to |L[i+1]|-1 do", vars ), tree, new ForLoop( "l1", "0", "end_" ), alg );
+        outerLoop.add( innerLoop );
+        PseudoCodeNode ifNode = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "if l1==|L[i+1]|-1 or L[i+1][l1] incident to inner segment between L[i+1] and L[i] then", vars ), tree, new CodeLine() {
 			@Override
 			public ControlFlow runForward(Memory m) {
-				// TODO Auto-generated method stub
-				return null;
+				if( m.isDefined( "line_" + lineId + "_inside", false ) )
+				{
+					StackFrame old = m.removeFrame();
+					actions.push( (Memory mem) -> {
+						mem.addFrame( old );
+		            	return new ControlFlow( ControlFlow.STEP_INTO );
+					} );
+	                return new ControlFlow( ControlFlow.STEP_OVER );
+				}
+				else
+				{
+		            if( m.<LayeredGraphNode>read( "graph", false ).getContainedLayers().get( m.<Integer>read( "i", false ) + 1).size() == m.<Integer>read( "l1", false ) || 
+		            		incidentToInnerSegmentBetweenLiPlusOneAndLi( m ) ) {
+		            	m.addFrame( new StackFrame( FrameType.LOOP ) );
+		            	m.declare( "line_" + lineId + "_inside", true, false );
+		            	actions.push( (Memory mem) -> {
+		            		mem.removeFrame();
+		            		return new ControlFlow( ControlFlow.STEP_OVER );
+		            	} );
+		            	return new ControlFlow( ControlFlow.STEP_INTO );
+		            } else {
+		            	m.declare( "line_" + lineId + "_inside", false, false );
+		            	actions.push( (Memory mem) -> {
+		            		mem.undeclare( "line_" + lineId + "_inside", false );
+			                return new ControlFlow( ControlFlow.STEP_OVER );
+		            	} );
+		                return new ControlFlow( ControlFlow.STEP_OVER );
+		            }
+				}
 			}
-        	
-        }, alg);
-        lines[ 0 ].add( lines[ 1 ] );
+        }, alg );
+        innerLoop.add( ifNode );
         /*
-        lines[ 2 ] = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "for l1=0 to |L[i+1]|-1 do", vars ), tree );
-        lines[ 0 ].add( lines[ 2 ] );
-        lines[ 3 ] = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "if l1==|L[i+1]|-1 or L[i+1][l1] incident to inner segment between L[i+1] and L[i] then", vars ), tree );
-        lines[ 2 ].add( lines[ 3 ] );
         lines[ 4 ] = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "k1 = |L[i]|-1;", vars ), tree );
         lines[ 3 ].add( lines[ 4 ] );
         lines[ 5 ] = new PseudoCodeNode( TextLayoutHelper.setupPseudoCode( "if L[i+1][l1] incident to inner segment between L[i+1] and L[i] then", vars ), tree );
@@ -95,6 +136,16 @@ public class ConflictDetection implements AlgorithmStage {
         root.add( lines[ 15 ] );*/
         return root;
     }
+    
+    private boolean incidentToInnerSegmentBetweenLiPlusOneAndLi( Memory m ) {
+        LayeredGraphNode curr = m.<LayeredGraphNode>read( "graph", false ).getContainedLayers().get( m.<Integer>read( "i", false ) + 1 ).get( m.read( "l1", false ) );
+        for (LayeredGraphEdge e : curr.getIncomingEdges()) {
+            if (e.isDummyEdge()) {
+                return true;
+            }
+        }
+        return false;
+    }
 
     @Override
     public String getDebugString() {/*

+ 5 - 5
src/codelines/BackwardForEachLoop.java

@@ -30,7 +30,7 @@ public class BackwardForEachLoop <T> extends CodeLine {
 		if( m.<Integer>read( "line_" + lineId + "_index", false ) < 0 ) // prove if the loop has finished
 		{
 			m.undeclare( "line_" + lineId + "_index", false );
-			actions.add( (Memory mem) -> {
+			actions.push( (Memory mem) -> {
 				return new ControlFlow( ControlFlow.STEP_OVER ); // loop was not called so nothing to reverse
 			});
 			return new ControlFlow( ControlFlow.STEP_OVER ); // don't execute the loop body
@@ -39,7 +39,7 @@ public class BackwardForEachLoop <T> extends CodeLine {
 		{
 			m.addFrame( new StackFrame( FrameType.LOOP ) );
 			m.declare( loopVar, m.<List<T>>read( listVar, false ).get( m.read( "line_" + lineId + "_index", false ) ), false ); // set loop variable
-			actions.add( (Memory mem) -> {
+			actions.push( (Memory mem) -> {
 				mem.removeFrame();
 				mem.undeclare( "line_" + lineId + "_index", false );
 				return new ControlFlow( ControlFlow.STEP_OVER ); // step out of the loop
@@ -53,7 +53,7 @@ public class BackwardForEachLoop <T> extends CodeLine {
 			{
 				StackFrame sf = m.removeFrame(); // remove loop stack
 				m.undeclare( "line_" + lineId + "_index", false );
-				actions.add( (Memory mem) -> {
+				actions.push( (Memory mem) -> {
 					mem.write( "line_" + lineId + "_index", oldIndex, false );
 					mem.addFrame( sf ); // restore last loop stack
 					return new ControlFlow( ControlFlow.STEP_INTO ); // step into the loop body
@@ -64,8 +64,8 @@ public class BackwardForEachLoop <T> extends CodeLine {
 			m.addFrame( new StackFrame( FrameType.LOOP ) );
 			m.write( loopVar, m.<List<T>>read( listVar, false ).get( m.read( "line_" + lineId + "_index", false ) ), false ); // update loop variable
 			actions.push( (Memory mem) -> {
-				m.removeFrame();
-				m.addFrame( old );
+				mem.removeFrame();
+				mem.addFrame( old );
 				mem.write( "line_" + lineId + "_index", oldIndex, false );
 				return new ControlFlow( ControlFlow.STEP_INTO );
 			});

+ 3 - 3
src/codelines/DeclareVariable.java

@@ -22,11 +22,11 @@ public class DeclareVariable <T> extends CodeLine {
 		oldExists = m.isDefined( name, false );
 		T oldVal = m.read( name, false );
 		m.declare( name, val, false );
-		actions.add( (Memory mem) -> {
+		actions.push( (Memory mem) -> {
 			if( !oldExists )
-				m.undeclare( name, false );
+				mem.undeclare( name, false );
 			else
-				m.declare( name, oldVal, false );
+				mem.declare( name, oldVal, false );
 			return new ControlFlow( ControlFlow.STEP_OVER );
 		});
 		return new ControlFlow( ControlFlow.STEP_OVER );

+ 7 - 7
src/codelines/DefaultForEachLoop.java → src/codelines/ForEachLoop.java

@@ -8,12 +8,12 @@ import animation.Memory;
 import animation.StackFrame;
 import animation.StackFrame.FrameType;
 
-public class DefaultForEachLoop <T> extends CodeLine {
+public class ForEachLoop <T> extends CodeLine {
 
 	String listVar;
 	String loopVar;
 	
-	public DefaultForEachLoop( String listName, String varName )
+	public ForEachLoop( String listName, String varName )
 	{
 		this.listVar = listName;
 		this.loopVar = varName;
@@ -30,7 +30,7 @@ public class DefaultForEachLoop <T> extends CodeLine {
 		if( m.<Integer>read( "line_" + lineId + "_index", false ) > m.<List<T>>read( listVar, false ).size() - 1 ) // prove if the loop has finished
 		{
 			m.undeclare( "line_" + lineId + "_index", false );
-			actions.add( (Memory mem) -> {
+			actions.push( (Memory mem) -> {
 				return new ControlFlow( ControlFlow.STEP_OVER ); // loop was not called so nothing to reverse
 			});
 			return new ControlFlow( ControlFlow.STEP_OVER ); // don't execute the loop body
@@ -39,7 +39,7 @@ public class DefaultForEachLoop <T> extends CodeLine {
 		{
 			m.addFrame( new StackFrame( FrameType.LOOP ) );
 			m.declare( loopVar, m.<List<T>>read( listVar, false ).get( m.read( "line_" + lineId + "_index", false ) ), false ); // set loop variable
-			actions.add( (Memory mem) -> {
+			actions.push( (Memory mem) -> {
 				mem.removeFrame();
 				mem.undeclare( "line_" + lineId + "_index", false );
 				return new ControlFlow( ControlFlow.STEP_OVER ); // step out of the loop
@@ -53,7 +53,7 @@ public class DefaultForEachLoop <T> extends CodeLine {
 			{
 				StackFrame sf = m.removeFrame(); // remove loop stack
 				m.undeclare( "line_" + lineId + "_index", false );
-				actions.add( (Memory mem) -> {
+				actions.push( (Memory mem) -> {
 					mem.write( "line_" + lineId + "_index", oldIndex, false );
 					mem.addFrame( sf ); // restore last loop stack
 					return new ControlFlow( ControlFlow.STEP_INTO ); // step into the loop body
@@ -64,8 +64,8 @@ public class DefaultForEachLoop <T> extends CodeLine {
 			m.addFrame( new StackFrame( FrameType.LOOP ) );
 			m.write( loopVar, m.<List<T>>read( listVar, false ).get( m.read( "line_" + lineId + "_index", false ) ), false ); // update loop variable
 			actions.push( (Memory mem) -> {
-				m.removeFrame();
-				m.addFrame( old );
+				mem.removeFrame();
+				mem.addFrame( old );
 				mem.write( "line_" + lineId + "_index", oldIndex, false );
 				return new ControlFlow( ControlFlow.STEP_INTO );
 			});

+ 75 - 0
src/codelines/ForLoop.java

@@ -0,0 +1,75 @@
+package codelines;
+
+import animation.CodeLine;
+import animation.ControlFlow;
+import animation.Memory;
+import animation.StackFrame;
+import animation.StackFrame.FrameType;
+
+public class ForLoop extends CodeLine {
+
+	String loopVar;
+	private String start;
+	private String end;
+	
+	public ForLoop( String varName, String start, String end )
+	{
+		this.loopVar = varName;
+		this.start = start;
+		this.end = end;
+	}
+	
+	@Override
+	public ControlFlow runForward(Memory m) {
+		boolean declared = false; // prove if it is the first step in the loop
+		if( !m.isSomewhereDefined( "line_" + lineId + "_index", false ) )
+		{ // first loop step
+			m.declare( "line_" + lineId + "_index", (int)m.<Integer>read( start, false ), false );
+			declared = true;
+		}
+		if( m.<Integer>read( "line_" + lineId + "_index", false ) > m.<Integer>read( end, false ) ) // prove if the loop has finished
+		{
+			m.undeclare( "line_" + lineId + "_index", false );
+			actions.push( (Memory mem) -> {
+				return new ControlFlow( ControlFlow.STEP_OVER ); // loop was not called so nothing to reverse
+			});
+			return new ControlFlow( ControlFlow.STEP_OVER ); // don't execute the loop body
+		}
+		if( declared )
+		{
+			m.addFrame( new StackFrame( FrameType.LOOP ) );
+			m.declare( loopVar, (int)m.<Integer>read( start, false ), false ); // set loop variable
+			actions.push( (Memory mem) -> {
+				mem.removeFrame();
+				mem.undeclare( "line_" + lineId + "_index", false );
+				return new ControlFlow( ControlFlow.STEP_OVER ); // step out of the loop
+			} );
+		}
+		else
+		{
+			int oldIndex = m.<Integer>read( "line_" + lineId + "_index", false );
+			m.write( "line_" + lineId + "_index", oldIndex + 1, false ); // count index down
+			if( m.<Integer>read( "line_" + lineId + "_index", false ) > m.<Integer>read( end, false ) ) // prove if loop was finished
+			{
+				StackFrame sf = m.removeFrame(); // remove loop stack
+				m.undeclare( "line_" + lineId + "_index", false );
+				actions.add( (Memory mem) -> {
+					mem.write( "line_" + lineId + "_index", oldIndex, false );
+					mem.addFrame( sf ); // restore last loop stack
+					return new ControlFlow( ControlFlow.STEP_INTO ); // step into the loop body
+				});
+				return new ControlFlow( ControlFlow.STEP_OVER ); // step out of the loop
+			}
+			StackFrame old = m.removeFrame(); // fresh stack frame for loop body
+			m.addFrame( new StackFrame( FrameType.LOOP ) );
+			m.write( loopVar, (int)m.read( "line_" + lineId + "_index", false ), false ); // update loop variable
+			actions.push( (Memory mem) -> {
+				mem.removeFrame();
+				mem.addFrame( old );
+				mem.write( "line_" + lineId + "_index", oldIndex, false );
+				return new ControlFlow( ControlFlow.STEP_INTO );
+			});
+		}
+		return new ControlFlow( ControlFlow.STEP_INTO );
+	}
+}

+ 58 - 0
src/codelines/FunctionDefinition.java

@@ -0,0 +1,58 @@
+package codelines;
+
+import animation.CodeLine;
+import animation.ControlFlow;
+import animation.Memory;
+import animation.StackFrame;
+import animation.StackFrame.FrameType;
+
+public class FunctionDefinition extends CodeLine {
+
+	private String[] params;
+	
+	public FunctionDefinition( String[] params )
+	{
+		this.params = params;
+	}
+	
+	@Override
+	public ControlFlow runForward(Memory m) {
+		if( !m.isDefined( "param1", true ) && !m.isDefined( "line_" + lineId + "_inside", false ) )
+			return new ControlFlow( ControlFlow.STEP_OVER );
+		if( !m.isDefined( "line_" + lineId + "_inside", false ) )
+		{
+			m.addFrame( new StackFrame( FrameType.FUNCTION ) );
+			m.declare( "line_" + lineId + "_inside", true, false );
+			int index = 1;
+			Object olds[] = new Object[ params.length ];
+			for( String p : params )
+			{
+				olds[ index - 1 ] = m.read( "param" + index, true );
+				m.declare( p, olds[ index - 1 ], false );
+				m.undeclare( "param" + index, true );
+				index++;
+			}
+			actions.push( (Memory mem) -> {
+				mem.removeFrame();
+				int i = 1;
+				for( @SuppressWarnings("unused") String p : params )
+				{
+					mem.declare( "param" + i, olds[ i - 1], true );
+					i++;
+				}
+				return new ControlFlow( ControlFlow.STEP_OVER );
+			} );
+			return new ControlFlow( ControlFlow.STEP_INTO );
+		}
+		else
+		{
+			StackFrame frame = m.removeFrame();
+			actions.push( (Memory mem) -> {
+				mem.addFrame( frame );
+				return new ControlFlow( ControlFlow.STEP_INTO ); // call function backwards
+			} );
+			return new ControlFlow( ControlFlow.STEP_OVER ); // return
+		}
+	}
+
+}

+ 1 - 1
src/lib/TextLayoutHelper.java

@@ -21,7 +21,7 @@ public class TextLayoutHelper {
     }
     
     private static String[] keywords = { "for", "do", "to", "then", "else", "if", "foreach", "while", "or", "and", "call", "function" };
-    private static String[] delimiter = { "\\+", "\\-", "\\[", "\\]", "\\|", " ", "^", "$", "\\=", "\\,", "\\(", "\\;" };
+    private static String[] delimiter = { "\\+", "\\-", "\\[", "\\]", "\\|", " ", "^", "$", "\\=", "\\,", "\\(", "\\;", "\\." };
     
     private static String getDelimiterRegex()
     {