• R/O
  • SSH
  • HTTPS

jobjectpascal: Commit


Commit MetaInfo

Revision132 (tree)
Time2015-06-13 18:02:36
Authoriga

Log Message

refactoring.

Change Summary

Incremental Difference

--- trunk/src/jp/igapyon/jobjectpascal/parser/ast/PascalAstType.java (revision 131)
+++ trunk/src/jp/igapyon/jobjectpascal/parser/ast/PascalAstType.java (revision 132)
@@ -1,6 +1,5 @@
11 package jp.igapyon.jobjectpascal.parser.ast;
22
3-
43 public class PascalAstType extends PascalAstNodeImpl {
54 protected String typeName;
65 protected String parentTypeName;
@@ -31,7 +30,8 @@
3130 }
3231
3332 public String getString() {
34- return getName() + ": " + getValue() + ": " + getTypeName()
35- + ": parent[" + getParentTypeName() + "]"+(isForwardDeclaration()?" forwardDecl":"");
33+ return getName() + ": " + getTypeName() + ": parent["
34+ + getParentTypeName() + "]"
35+ + (isForwardDeclaration() ? " forwardDecl" : "");
3636 }
3737 }
--- trunk/src/jp/igapyon/jobjectpascal/parser/ast/PascalAstVar.java (nonexistent)
+++ trunk/src/jp/igapyon/jobjectpascal/parser/ast/PascalAstVar.java (revision 132)
@@ -0,0 +1,26 @@
1+package jp.igapyon.jobjectpascal.parser.ast;
2+
3+public class PascalAstVar extends PascalAstNodeImpl {
4+ protected String varName;
5+ protected String varValue;
6+
7+ public String getVarName() {
8+ return varName;
9+ }
10+
11+ public void setVarName(String varName) {
12+ this.varName = varName;
13+ }
14+
15+ public String getVarValue() {
16+ return varValue;
17+ }
18+
19+ public void setVarValue(String varValue) {
20+ this.varValue = varValue;
21+ }
22+
23+ public String getString() {
24+ return getName() + ": " + getVarName() + ": " + getVarValue();
25+ }
26+}
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
--- trunk/src/jp/igapyon/jobjectpascal/parser/syntax/PascalSyntaxTokenUsesParser.java (revision 131)
+++ trunk/src/jp/igapyon/jobjectpascal/parser/syntax/PascalSyntaxTokenUsesParser.java (revision 132)
@@ -6,12 +6,12 @@
66
77 public class PascalSyntaxTokenUsesParser {
88 public void parse(PascalSyntaxProcessInfo processInfo) {
9- final PascalAstNodeImpl statement = new PascalAstNodeImpl();
10- statement.setName("uses");
9+ final PascalAstNodeImpl ast = new PascalAstNodeImpl();
10+ ast.setName("uses");
1111
12- statement.setValue(PascalSyntaxTokenUtil.readToDelimWithoutWhitespaces(
12+ ast.setValue(PascalSyntaxTokenUtil.readToDelimWithoutWhitespaces(
1313 processInfo, ";"));
1414
15- processInfo.syntaxTokenList.add(statement);
15+ processInfo.syntaxTokenList.add(ast);
1616 }
1717 }
--- trunk/src/jp/igapyon/jobjectpascal/parser/syntax/PascalSyntaxTokenConstParser.java (revision 131)
+++ trunk/src/jp/igapyon/jobjectpascal/parser/syntax/PascalSyntaxTokenConstParser.java (revision 132)
@@ -35,15 +35,15 @@
3535 }
3636
3737 public void parse(PascalSyntaxProcessInfo processInfo) {
38- final PascalAstConst statement = new PascalAstConst();
39- statement.setName("const");
38+ final PascalAstConst ast = new PascalAstConst();
39+ ast.setName("const");
4040
41- statement.setConstName(PascalSyntaxTokenUtil.readToDelimWithoutWhitespaces(
41+ ast.setConstName(PascalSyntaxTokenUtil.readToDelimWithoutWhitespaces(
4242 processInfo, "="));
4343 processInfo.lexicalIndex++;
44- statement.setConstValue(PascalSyntaxTokenUtil.readToDelimWithoutWhitespaces(
44+ ast.setConstValue(PascalSyntaxTokenUtil.readToDelimWithoutWhitespaces(
4545 processInfo, ";"));
4646
47- processInfo.syntaxTokenList.add(statement);
47+ processInfo.syntaxTokenList.add(ast);
4848 }
4949 }
--- trunk/src/jp/igapyon/jobjectpascal/parser/syntax/PascalSyntaxTokenProgramParser.java (revision 131)
+++ trunk/src/jp/igapyon/jobjectpascal/parser/syntax/PascalSyntaxTokenProgramParser.java (revision 132)
@@ -6,12 +6,12 @@
66
77 public class PascalSyntaxTokenProgramParser {
88 public void parse(PascalSyntaxProcessInfo processInfo) {
9- final PascalAstNodeImpl statement = new PascalAstNodeImpl();
10- statement.setName("program");
9+ final PascalAstNodeImpl ast = new PascalAstNodeImpl();
10+ ast.setName("program");
1111
12- statement.setValue(PascalSyntaxTokenUtil.readToDelimWithoutWhitespaces(
12+ ast.setValue(PascalSyntaxTokenUtil.readToDelimWithoutWhitespaces(
1313 processInfo, ";"));
1414
15- processInfo.syntaxTokenList.add(statement);
15+ processInfo.syntaxTokenList.add(ast);
1616 }
1717 }
--- trunk/src/jp/igapyon/jobjectpascal/parser/syntax/PascalSyntaxTokenVarParser.java (revision 131)
+++ trunk/src/jp/igapyon/jobjectpascal/parser/syntax/PascalSyntaxTokenVarParser.java (revision 132)
@@ -5,6 +5,7 @@
55 import jp.igapyon.jobjectpascal.parser.PascalSyntaxProcessInfo;
66 import jp.igapyon.jobjectpascal.parser.PascalSyntaxTokenUtil;
77 import jp.igapyon.jobjectpascal.parser.ast.PascalAstNodeImpl;
8+import jp.igapyon.jobjectpascal.parser.ast.PascalAstVar;
89
910 public class PascalSyntaxTokenVarParser {
1011 public void parseMuiti(PascalSyntaxProcessInfo processInfo) {
@@ -34,12 +35,15 @@
3435 }
3536
3637 public void parse(PascalSyntaxProcessInfo processInfo) {
37- final PascalAstNodeImpl statement = new PascalAstNodeImpl();
38- statement.setName("var");
38+ final PascalAstVar ast = new PascalAstVar();
39+ ast.setName("var");
3940
40- statement.setValue(PascalSyntaxTokenUtil.readToDelimWithoutWhitespaces(
41- processInfo, ";"));
41+ ast.setVarName(PascalSyntaxTokenUtil
42+ .readToDelimWithoutWhitespaces(processInfo, ":"));
43+ processInfo.lexicalIndex++;
44+ ast.setVarValue(PascalSyntaxTokenUtil
45+ .readToDelimWithoutWhitespaces(processInfo, ";"));
4246
43- processInfo.syntaxTokenList.add(statement);
47+ processInfo.syntaxTokenList.add(ast);
4448 }
4549 }
Show on old repository browser