Index: grammar/parser.y =================================================================== RCS file: /cvsroot/qdox/qdox/src/grammar/parser.y,v retrieving revision 1.34 diff -u -r1.34 parser.y --- grammar/parser.y 17 May 2004 13:31:08 -0000 1.34 +++ grammar/parser.y 18 May 2004 07:32:26 -0000 @@ -54,9 +54,9 @@ javadoctags: | javadoctags javadoctag; javadoctag: - JAVADOCTAG { tagLine = lexer.getLine(); } + JAVADOCTAG { line = lexer.getLine(); } javadoctokens { - builder.addJavaDocTag(new TagDef($1.substring(1), buffer(), tagLine)); + builder.addJavaDocTag(new TagDef($1.substring(1), buffer(), line)); }; @@ -109,9 +109,10 @@ }; classdefinition: - modifiers classorinterface IDENTIFIER extends implements { + { line = lexer.getLine(); } modifiers classorinterface IDENTIFIER extends implements { + cls.lineNumber = line; cls.modifiers.addAll(modifiers); modifiers.clear(); - cls.name = $3; + cls.name = $4; builder.beginClass(cls); cls = new ClassDef(); }; @@ -132,7 +133,7 @@ fullidentifier { cls.implementz.add($1); } | implementslist COMMA fullidentifier { cls.implementz.add($3); }; -members: | members member; +members: | members { line = lexer.getLine(); } member; member: javadoc | @@ -158,8 +159,8 @@ }; extrafields: | - extrafields COMMA arrayidentifier { - makeField($3); + extrafields COMMA { line = lexer.getLine(); } arrayidentifier { + makeField($4); }; @@ -167,15 +168,17 @@ method: modifiers type IDENTIFIER methoddef memberend { + mth.lineNumber = line; mth.modifiers.addAll(modifiers); modifiers.clear(); mth.returns = $2.name; mth.dimensions = $2.dimensions; - mth.name = $3; + mth.name = $3; builder.addMethod(mth); mth = new MethodDef(); }; constructor: - modifiers IDENTIFIER methoddef memberend { + modifiers IDENTIFIER methoddef memberend { + mth.lineNumber = line; mth.modifiers.addAll(modifiers); modifiers.clear(); mth.constructor = true; mth.name = $2; builder.addMethod(mth); @@ -216,7 +219,7 @@ private FieldDef param = new FieldDef(); private java.util.Set modifiers = new java.util.HashSet(); private TypeDef fieldType; -private int tagLine; +private int line; private String buffer() { if (textBuffer.length() > 0) textBuffer.deleteCharAt(textBuffer.length() - 1); @@ -261,6 +264,7 @@ private void makeField(TypeDef field) { FieldDef fd = new FieldDef(); + fd.lineNumber = line; fd.modifiers.addAll(modifiers); fd.type = fieldType.name; fd.dimensions = fieldType.dimensions + field.dimensions; Index: java/com/thoughtworks/qdox/model/AbstractInheritableJavaEntity.java =================================================================== RCS file: /cvsroot/qdox/qdox/src/java/com/thoughtworks/qdox/model/AbstractInheritableJavaEntity.java,v retrieving revision 1.3 diff -u -r1.3 AbstractInheritableJavaEntity.java --- java/com/thoughtworks/qdox/model/AbstractInheritableJavaEntity.java 8 Jan 2004 20:44:29 -0000 1.3 +++ java/com/thoughtworks/qdox/model/AbstractInheritableJavaEntity.java 18 May 2004 07:32:26 -0000 @@ -10,8 +10,8 @@ return tags.length > 0 ? tags[0] : null; } - protected AbstractInheritableJavaEntity(JavaClassParent parent) { - super(parent); + protected AbstractInheritableJavaEntity(JavaClassParent parent, int lineNumber) { + super(parent, lineNumber); } public abstract DocletTag[] getTagsByName(String name, boolean inherited); Index: java/com/thoughtworks/qdox/model/AbstractJavaEntity.java =================================================================== RCS file: /cvsroot/qdox/qdox/src/java/com/thoughtworks/qdox/model/AbstractJavaEntity.java,v retrieving revision 1.16 diff -u -r1.16 AbstractJavaEntity.java --- java/com/thoughtworks/qdox/model/AbstractJavaEntity.java 17 May 2004 13:31:08 -0000 1.16 +++ java/com/thoughtworks/qdox/model/AbstractJavaEntity.java 18 May 2004 07:32:27 -0000 @@ -13,9 +13,15 @@ private String comment; private DocletTag[] tags = new DocletTag[0]; private final JavaClassParent parent; + private final int lineNumber; - protected AbstractJavaEntity(JavaClassParent parent) { + protected AbstractJavaEntity(JavaClassParent parent, int lineNumber) { this.parent = parent; + this.lineNumber = lineNumber; + } + + public int getLineNumber() { + return lineNumber; } public String getName() { Index: java/com/thoughtworks/qdox/model/JavaClass.java =================================================================== RCS file: /cvsroot/qdox/qdox/src/java/com/thoughtworks/qdox/model/JavaClass.java,v retrieving revision 1.40 diff -u -r1.40 JavaClass.java --- java/com/thoughtworks/qdox/model/JavaClass.java 23 Jan 2004 23:18:30 -0000 1.40 +++ java/com/thoughtworks/qdox/model/JavaClass.java 18 May 2004 07:32:27 -0000 @@ -33,8 +33,12 @@ private Type[] implementz = new Type[0]; private JavaClassCache javaClassCache; + public JavaClass(JavaClassParent parent, int lineNumber) { + super(parent, lineNumber); + } + public JavaClass(JavaClassParent parent) { - super(parent); + super(parent, 0); } public void setJavaClassCache(JavaClassCache javaClassCache) { Index: java/com/thoughtworks/qdox/model/JavaField.java =================================================================== RCS file: /cvsroot/qdox/qdox/src/java/com/thoughtworks/qdox/model/JavaField.java,v retrieving revision 1.9 diff -u -r1.9 JavaField.java --- java/com/thoughtworks/qdox/model/JavaField.java 26 Apr 2004 18:50:45 -0000 1.9 +++ java/com/thoughtworks/qdox/model/JavaField.java 18 May 2004 07:32:27 -0000 @@ -4,12 +4,16 @@ private Type type; + public JavaField(JavaClass parent, int lineNumber) { + super(parent, lineNumber); + } + public JavaField(JavaClass parent) { - super(parent); + super(parent, 0); } public JavaField() { - this(null); + this(null, 0); } public Type getType() { Index: java/com/thoughtworks/qdox/model/JavaMethod.java =================================================================== RCS file: /cvsroot/qdox/qdox/src/java/com/thoughtworks/qdox/model/JavaMethod.java,v retrieving revision 1.20 diff -u -r1.20 JavaMethod.java --- java/com/thoughtworks/qdox/model/JavaMethod.java 26 Apr 2004 18:50:45 -0000 1.20 +++ java/com/thoughtworks/qdox/model/JavaMethod.java 18 May 2004 07:32:27 -0000 @@ -11,12 +11,16 @@ private Type[] exceptions = Type.EMPTY_ARRAY; private boolean constructor; + public JavaMethod(JavaClass parent, int lineNumber) { + super(parent, lineNumber); + } + public JavaMethod(JavaClass parent) { - super(parent); + super(parent, 0); } public JavaMethod() { - this(null); + this(null, 0); } public Type getReturns() { Index: java/com/thoughtworks/qdox/model/ModelBuilder.java =================================================================== RCS file: /cvsroot/qdox/qdox/src/java/com/thoughtworks/qdox/model/ModelBuilder.java,v retrieving revision 1.24 diff -u -r1.24 ModelBuilder.java --- java/com/thoughtworks/qdox/model/ModelBuilder.java 17 May 2004 13:31:08 -0000 1.24 +++ java/com/thoughtworks/qdox/model/ModelBuilder.java 18 May 2004 07:32:27 -0000 @@ -55,7 +55,7 @@ } public void beginClass(ClassDef def) { - currentClass = new JavaClass(currentParent); + currentClass = new JavaClass(currentParent, def.lineNumber); // basic details currentClass.setName(def.name); @@ -130,7 +130,7 @@ } public void addMethod(MethodDef def) { - JavaMethod currentMethod = new JavaMethod(currentClass); + JavaMethod currentMethod = new JavaMethod(currentClass, def.lineNumber); // basic details currentMethod.setName(def.name); @@ -172,7 +172,7 @@ } public void addField(FieldDef def) { - JavaField currentField = new JavaField(currentClass); + JavaField currentField = new JavaField(currentClass, def.lineNumber); currentField.setName(def.name); currentField.setType(createType(def.type, def.dimensions)); Index: java/com/thoughtworks/qdox/parser/structs/ClassDef.java =================================================================== RCS file: /cvsroot/qdox/qdox/src/java/com/thoughtworks/qdox/parser/structs/ClassDef.java,v retrieving revision 1.3 diff -u -r1.3 ClassDef.java --- java/com/thoughtworks/qdox/parser/structs/ClassDef.java 22 Jul 2003 00:37:33 -0000 1.3 +++ java/com/thoughtworks/qdox/parser/structs/ClassDef.java 18 May 2004 07:32:27 -0000 @@ -3,7 +3,7 @@ import java.util.HashSet; import java.util.Set; -public class ClassDef { +public class ClassDef extends LocatedDef { public String name = ""; public Set modifiers = new HashSet(); public Set extendz = new HashSet(); Index: java/com/thoughtworks/qdox/parser/structs/FieldDef.java =================================================================== RCS file: /cvsroot/qdox/qdox/src/java/com/thoughtworks/qdox/parser/structs/FieldDef.java,v retrieving revision 1.3 diff -u -r1.3 FieldDef.java --- java/com/thoughtworks/qdox/parser/structs/FieldDef.java 22 Jul 2003 00:37:33 -0000 1.3 +++ java/com/thoughtworks/qdox/parser/structs/FieldDef.java 18 May 2004 07:32:27 -0000 @@ -3,7 +3,7 @@ import java.util.HashSet; import java.util.Set; -public class FieldDef { +public class FieldDef extends LocatedDef { public String name = ""; public String type = ""; public Set modifiers = new HashSet(); Index: java/com/thoughtworks/qdox/parser/structs/LocatedDef.java =================================================================== RCS file: java/com/thoughtworks/qdox/parser/structs/LocatedDef.java diff -N java/com/thoughtworks/qdox/parser/structs/LocatedDef.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ java/com/thoughtworks/qdox/parser/structs/LocatedDef.java 18 May 2004 07:32:27 -0000 @@ -0,0 +1,7 @@ +package com.thoughtworks.qdox.parser.structs; + +public class LocatedDef { + + public int lineNumber; + +} Index: java/com/thoughtworks/qdox/parser/structs/MethodDef.java =================================================================== RCS file: /cvsroot/qdox/qdox/src/java/com/thoughtworks/qdox/parser/structs/MethodDef.java,v retrieving revision 1.3 diff -u -r1.3 MethodDef.java --- java/com/thoughtworks/qdox/parser/structs/MethodDef.java 22 Jul 2003 00:37:33 -0000 1.3 +++ java/com/thoughtworks/qdox/parser/structs/MethodDef.java 18 May 2004 07:32:27 -0000 @@ -5,7 +5,7 @@ import java.util.List; import java.util.Set; -public class MethodDef { +public class MethodDef extends LocatedDef { public String name = ""; public String returns = ""; public Set modifiers = new HashSet(); Index: java/com/thoughtworks/qdox/parser/structs/TagDef.java =================================================================== RCS file: /cvsroot/qdox/qdox/src/java/com/thoughtworks/qdox/parser/structs/TagDef.java,v retrieving revision 1.1 diff -u -r1.1 TagDef.java --- java/com/thoughtworks/qdox/parser/structs/TagDef.java 17 May 2004 13:31:59 -0000 1.1 +++ java/com/thoughtworks/qdox/parser/structs/TagDef.java 18 May 2004 07:32:27 -0000 @@ -1,10 +1,9 @@ package com.thoughtworks.qdox.parser.structs; -public class TagDef { +public class TagDef extends LocatedDef { public String name; public String text; - public int lineNumber; public TagDef(String name, String text, int lineNumber) { this.name = name;