fixes
authorChristian Grothoff <christian@grothoff.org>
Thu, 19 May 2011 08:36:54 +0000 (08:36 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 19 May 2011 08:36:54 +0000 (08:36 +0000)
src/monkey/seaspider/org/gnunet/seaspider/ExpressionDatabaseHandler.java
src/monkey/seaspider/org/gnunet/seaspider/ExpressionExtractorVisitor.java

index b9a1e2cf8aaafd91358b50fb51e356a28fdd8fa5..1627aca2632d66e9bae19a8642cc670eb4caf993 100644 (file)
@@ -197,7 +197,8 @@ public class ExpressionDatabaseHandler {
                }
                
                String[] fileNameArr = fileName.split("src/");
-               fileName = fileNameArr[1];
+               if (fileNameArr.length > 1)
+                       fileName = fileNameArr[1];
                insertExpression(fileName, expressionSyntax, startLineNo, endLineNo);
        }
 }
index 06643fdbd04b93ef6529269d22416b8ff53ef03a..b93b19d3d7b43fcc8c6bf9e834766958fb06bafa 100644 (file)
@@ -411,11 +411,19 @@ public class ExpressionExtractorVisitor extends DepthFirstVisitor {
                current_expression = new ExpressionBuilder();
                n.f0.accept(this);
                if (n.f1.present()) {
+                       LineNumberInfo lin = LineNumberInfo.get(n.f0);
+                       current_expression.commit(lin.lineEnd);
                        operator = true;
                        NodeSequence ns = (NodeSequence) n.f1.node;
                        ns.nodes.get(0).accept(this);
                        operator = false;
+                       ExpressionBuilder tmp = current_expression;
+                       current_expression = new ExpressionBuilder();                           
                        ns.nodes.get(1).accept(this);
+                       lin = LineNumberInfo.get(ns.nodes.get(1));
+                       current_expression.commit(lin.lineEnd);
+                       tmp.push (current_expression.expression);
+                       current_expression = tmp;
                }
                old.push(current_expression.expression);
                current_expression = old;
@@ -427,11 +435,19 @@ public class ExpressionExtractorVisitor extends DepthFirstVisitor {
                current_expression = new ExpressionBuilder();
                n.f0.accept(this);
                if (n.f1.present()) {
+                       LineNumberInfo lin = LineNumberInfo.get(n.f0);
+                       current_expression.commit(lin.lineEnd);
                        operator = true;
                        NodeSequence ns = (NodeSequence) n.f1.node;
                        ns.nodes.get(0).accept(this);
                        operator = false;
+                       ExpressionBuilder tmp = current_expression;
+                       current_expression = new ExpressionBuilder();                           
                        ns.nodes.get(1).accept(this);
+                       lin = LineNumberInfo.get(ns.nodes.get(1));
+                       current_expression.commit(lin.lineEnd);
+                       tmp.push (current_expression.expression);
+                       current_expression = tmp;
                }
                old.push(current_expression.expression);
                current_expression = old;
@@ -443,11 +459,19 @@ public class ExpressionExtractorVisitor extends DepthFirstVisitor {
                current_expression = new ExpressionBuilder();
                n.f0.accept(this);
                if (n.f1.present()) {
+                       LineNumberInfo lin = LineNumberInfo.get(n.f0);
+                       current_expression.commit(lin.lineEnd);
                        operator = true;
                        NodeSequence ns = (NodeSequence) n.f1.node;
                        ns.nodes.get(0).accept(this);
                        operator = false;
+                       ExpressionBuilder tmp = current_expression;
+                       current_expression = new ExpressionBuilder();                           
                        ns.nodes.get(1).accept(this);
+                       lin = LineNumberInfo.get(ns.nodes.get(1));
+                       current_expression.commit(lin.lineEnd);
+                       tmp.push (current_expression.expression);
+                       current_expression = tmp;
                }
                old.push(current_expression.expression);
                current_expression = old;
@@ -503,11 +527,19 @@ public class ExpressionExtractorVisitor extends DepthFirstVisitor {
                current_expression = new ExpressionBuilder();
                n.f0.accept(this);
                if (n.f1.present()) {
+                       LineNumberInfo lin = LineNumberInfo.get(n.f0);
+                       current_expression.commit(lin.lineEnd);
                        operator = true;
                        NodeSequence ns = (NodeSequence) n.f1.node;
                        ns.nodes.get(0).accept(this);
                        operator = false;
+                       ExpressionBuilder tmp = current_expression;
+                       current_expression = new ExpressionBuilder();                           
                        ns.nodes.get(1).accept(this);
+                       lin = LineNumberInfo.get(ns.nodes.get(1));
+                       current_expression.commit(lin.lineEnd);
+                       tmp.push (current_expression.expression);
+                       current_expression = tmp;
                }
                old.push(current_expression.expression);
                current_expression = old;
@@ -519,11 +551,19 @@ public class ExpressionExtractorVisitor extends DepthFirstVisitor {
                current_expression = new ExpressionBuilder();
                n.f0.accept(this);
                if (n.f1.present()) {
+                       LineNumberInfo lin = LineNumberInfo.get(n.f0);
+                       current_expression.commit(lin.lineEnd);
                        operator = true;
                        NodeSequence ns = (NodeSequence) n.f1.node;
                        ns.nodes.get(0).accept(this);
                        operator = false;
+                       ExpressionBuilder tmp = current_expression;
+                       current_expression = new ExpressionBuilder();                           
                        ns.nodes.get(1).accept(this);
+                       lin = LineNumberInfo.get(ns.nodes.get(1));
+                       current_expression.commit(lin.lineEnd);
+                       tmp.push (current_expression.expression);
+                       current_expression = tmp;
                }
                old.push(current_expression.expression);
                current_expression = old;
@@ -535,11 +575,19 @@ public class ExpressionExtractorVisitor extends DepthFirstVisitor {
                current_expression = new ExpressionBuilder();
                n.f0.accept(this);
                if (n.f1.present()) {
+                       LineNumberInfo lin = LineNumberInfo.get(n.f0);
+                       current_expression.commit(lin.lineEnd);
                        operator = true;
                        NodeSequence ns = (NodeSequence) n.f1.node;
                        ns.nodes.get(0).accept(this);
                        operator = false;
+                       ExpressionBuilder tmp = current_expression;
+                       current_expression = new ExpressionBuilder();                           
                        ns.nodes.get(1).accept(this);
+                       lin = LineNumberInfo.get(ns.nodes.get(1));
+                       current_expression.commit(lin.lineEnd);
+                       tmp.push (current_expression.expression);
+                       current_expression = tmp;
                }
                old.push(current_expression.expression);
                current_expression = old;
@@ -634,6 +682,8 @@ public class ExpressionExtractorVisitor extends DepthFirstVisitor {
                        current_expression = new ExpressionBuilder();
                        NodeSequence ns = (NodeSequence) n.f0.choice;
                        ns.elementAt(1).accept(this);
+                       LineNumberInfo lin1 = LineNumberInfo.get (ns.elementAt(1));
+                       current_expression.commit(lin1.lineEnd);
                        old.push("(");
                        old.push(current_expression.expression);
                        old.push(")");