From e059da0b0a3adf3aed23ae6564787a8a2b6afad5 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Tue, 24 Mar 2009 06:01:55 +0000 Subject: [PATCH] print out line count --- Robust/src/IR/State.java | 3 +++ Robust/src/Lex/Lexer.java | 2 +- Robust/src/Main/Main.java | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Robust/src/IR/State.java b/Robust/src/IR/State.java index 3b9288fc..9cfe1633 100644 --- a/Robust/src/IR/State.java +++ b/Robust/src/IR/State.java @@ -6,6 +6,8 @@ import java.util.*; import Analysis.TaskStateAnalysis.*; public class State { + + public int lines; public State() { this.classes=new SymbolTable(); this.tasks=new SymbolTable(); @@ -18,6 +20,7 @@ public class State { this.selfloops=new HashSet(); this.excprefetch=new HashSet(); this.classpath=new Vector(); + this.lines=0; } public void addParseNode(ParseNode parsetree) { diff --git a/Robust/src/Lex/Lexer.java b/Robust/src/Lex/Lexer.java index a7cbe1b4..7bcc6450 100644 --- a/Robust/src/Lex/Lexer.java +++ b/Robust/src/Lex/Lexer.java @@ -18,7 +18,7 @@ public class Lexer { boolean isJava15; String line = null; int line_pos = 1; - int line_num = 0; + public int line_num = 0; LineList lineL = new LineList(-line_pos, null); // sentinel for line #0 public Lexer(Reader reader) { diff --git a/Robust/src/Main/Main.java b/Robust/src/Main/Main.java index 06b9b747..f913eebc 100644 --- a/Robust/src/Main/Main.java +++ b/Robust/src/Main/Main.java @@ -337,6 +337,8 @@ public class Main { state.OWNERSHIPALIASFILE); } + + System.out.println("Lines="+state.lines); System.exit(0); } @@ -366,6 +368,7 @@ public class Main { System.out.println("Error parsing "+sourcefile); System.exit(l.numErrors()); } + state.lines+=l.line_num; return p; } catch (Exception e) { -- 2.34.1