Changeset 3570
- Timestamp:
- Mar 25, 2008, 6:43:39 PM (13 years ago)
- Location:
- devel-tools/trunk/eclipse
- Files:
-
- 1 deleted
- 42 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstAlt.java
r3566 r3570 31 31 v.visit(this, e); 32 32 } 33 34 @Override 35 public String toString () { 36 StringBuffer strBuf = new StringBuffer(); 37 strBuf.append(failMode.select("\\{", "{") + (sentenceList.length == 0 ? "" : " ")); 38 for (AstSentence sentence : sentenceList) { 39 String str = sentence.toString(); 40 strBuf.append((str.length() == 0 ? "" : str + " ") + "; "); 41 } 42 strBuf.append("}"); 43 return strBuf.toString(); 44 } 33 45 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstCall.java
r3566 r3570 18 18 19 19 @Override 20 public void accept (Exp Visitor v) {20 public void accept (ExprVisitor v) { 21 21 v.visit(this); 22 22 } 23 23 24 24 @Override 25 public <E> void accept (Exp VisitorWithEnv<E> v, E e) {25 public <E> void accept (ExprVisitorWithEnv<E> v, E e) { 26 26 v.visit(this, e); 27 27 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstCharSymbol.java
r3566 r3570 12 12 13 13 @Override 14 public void accept (Exp Visitor v) {14 public void accept (ExprVisitor v) { 15 15 v.visit(this); 16 16 } 17 17 18 18 @Override 19 public <E> void accept (Exp VisitorWithEnv<E> v, E e) {19 public <E> void accept (ExprVisitorWithEnv<E> v, E e) { 20 20 v.visit(this, e); 21 21 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstConstBinding.java
r3566 r3570 4 4 5 5 public final class AstConstBinding extends AstDecl { 6 public final AstExpr exp ;6 public final AstExpr expr; 7 7 8 public AstConstBinding (SrcPosition pos, AstName name, boolean isPublic, AstExpr exp ) {8 public AstConstBinding (SrcPosition pos, AstName name, boolean isPublic, AstExpr expr) { 9 9 super(pos, name, isPublic); 10 assert exp != null;11 this.exp = exp;10 assert expr != null; 11 this.expr = expr; 12 12 } 13 13 … … 21 21 v.visit(this, e); 22 22 } 23 23 24 24 public String getHoverInfo () { 25 25 String qname = getQualifiedName(); 26 26 if (qname == null) 27 27 return null; 28 return "$const " + qname + " = " + exp + ";"; 28 return "$const " + qname + " = " + expr + ";"; 29 } 30 31 @Override 32 public String toString () { 33 return (isPublic ? "$public " : "") + "$const " + name + " = " + expr + ";"; 29 34 } 30 35 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstCutAll.java
r3566 r3570 17 17 v.visit(this, e); 18 18 } 19 20 @Override 21 public String toString () { 22 return "="; 23 } 19 24 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstError.java
r3566 r3570 21 21 v.visit(this, e); 22 22 } 23 24 @Override 25 public String toString () { 26 String str = sentence.toString(); 27 return "$error" + (str.length() == 0 ? "" : " " + str); 28 } 23 29 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstExpr.java
r3567 r3570 18 18 } 19 19 20 public void accept (Exp Visitor v) {20 public void accept (ExprVisitor v) { 21 21 v.visit(this); 22 22 } 23 23 24 public <E> void accept (Exp VisitorWithEnv<E> v, E e) {24 public <E> void accept (ExprVisitorWithEnv<E> v, E e) { 25 25 v.visit(this, e); 26 26 } … … 28 28 @Override 29 29 public String toString () { 30 StringBuffer exp= new StringBuffer();30 StringBuffer strBuf = new StringBuffer(); 31 31 boolean flag = false; 32 32 for (AstTerm astTerm : termList) { 33 33 if (flag) 34 exp.append(' ');35 exp.append(astTerm);34 strBuf.append(' '); 35 strBuf.append(astTerm); 36 36 flag = true; 37 37 } 38 return exp.toString();38 return strBuf.toString(); 39 39 } 40 40 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstFail.java
r3566 r3570 17 17 v.visit(this, e); 18 18 } 19 20 @Override 21 public String toString () { 22 return "$fail"; 23 } 19 24 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstFormat.java
r3566 r3570 4 4 5 5 public final class AstFormat extends AstStatement { 6 public final AstExpr exp ;6 public final AstExpr expr; 7 7 8 public AstFormat (SrcPosition pos, AstExpr exp ) {8 public AstFormat (SrcPosition pos, AstExpr expr) { 9 9 super(pos); 10 assert exp != null;11 this.exp = exp;10 assert expr != null; 11 this.expr = expr; 12 12 } 13 13 … … 21 21 v.visit(this, e); 22 22 } 23 24 @Override 25 public String toString () { 26 String str = expr.toString(); 27 return "::" + (str.length() == 0 ? "" : " " + str); 28 } 23 29 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstFuncDecl.java
r3566 r3570 45 45 + outFormat + ";"; 46 46 } 47 48 @Override 49 public String toString () { 50 return (isPublic ? "$public " : "") + retMode.select("$func? ", "$func ") + name + " " + inFormat + " = " + outFormat + ";"; 51 } 47 52 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstFuncDef.java
r3566 r3570 31 31 return funcDecl.getHoverInfo(); 32 32 } 33 34 @Override 35 public String toString () { 36 String str = body.toString(); 37 return name + (str.length() == 0 ? "" : " " + str + " ") + ";"; 38 } 33 39 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstImplem.java
r3566 r3570 26 26 v.visit(this, e); 27 27 } 28 29 @Override 30 public String toString () { 31 StringBuffer strBuf = new StringBuffer(); 32 boolean flag = false; 33 if (astModuleName != null) { 34 strBuf.append("$module " + astModuleName + ";"); 35 flag = true; 36 } 37 for (AstUse use : useList) { 38 if (flag) 39 strBuf.append(' '); 40 strBuf.append(use); 41 flag = true; 42 } 43 for (AstTopNode topNode : topNodeList) { 44 if (flag) 45 strBuf.append(' '); 46 strBuf.append(topNode); 47 flag = true; 48 } 49 return strBuf.toString(); 50 } 28 51 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstInterf.java
r3566 r3570 22 22 v.visit(this, e); 23 23 } 24 25 @Override 26 public String toString () { 27 StringBuffer strBuf = new StringBuffer(); 28 boolean flag = false; 29 if (moduleName != null) { 30 strBuf.append("$module " + moduleName + ";"); 31 flag = true; 32 } 33 for (AstTopNode topNode : topNodeList) { 34 if (flag) 35 strBuf.append(' '); 36 strBuf.append(topNode); 37 flag = true; 38 } 39 return strBuf.toString(); 40 } 24 41 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstIter.java
r3566 r3570 23 23 v.visit(this, e); 24 24 } 25 26 @Override 27 public String toString () { 28 String str1 = sentence.toString(); 29 String str2 = target.toString(); 30 return "$iter" + (str1.length() == 0 ? "" : " " + str1) + " ::" + (str2.length() == 0 ? "" : " " + str2); 31 } 25 32 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstName.java
r3566 r3570 2 2 3 3 import org.refal.rfpdt.compiler.SrcPosition; 4 import org.refal.rfpdt.parser.RfpCharacter; 4 5 5 6 public final class AstName extends AstNode { … … 12 13 } 13 14 15 public boolean isIdenifier () { 16 if (identifier.length() == 0 || !RfpCharacter.isIdStartChar(identifier.charAt(0))) 17 return false; 18 for (int i = 1; i < identifier.length(); i++) 19 if (!RfpCharacter.isIdInternalChar(identifier.charAt(i))) 20 return false; 21 return true; 22 } 23 24 // public String getText () { 25 // return pos.length() > identifier.length() ? "\"" + identifier + "\"" : identifier; 26 // } 27 14 28 @Override 15 29 public String toString () { 16 return pos.length() > identifier.length() ? "\"" + identifier + "\"" : identifier;30 return isIdenifier() ? identifier : "\"" + identifier + "\""; 17 31 } 18 32 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstNative.java
r3566 r3570 27 27 v.visit(this, e); 28 28 } 29 30 @Override 31 public String toString () { 32 return "$native " + left + " = " + right + ";"; 33 } 29 34 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstNot.java
r3566 r3570 21 21 v.visit(this, e); 22 22 } 23 24 @Override 25 public String toString () { 26 return ("# " + sentence).trim(); 27 } 23 28 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstNumberSymbol.java
r3566 r3570 15 15 16 16 @Override 17 public void accept (Exp Visitor v) {17 public void accept (ExprVisitor v) { 18 18 v.visit(this); 19 19 } 20 20 21 21 @Override 22 public <E> void accept (Exp VisitorWithEnv<E> v, E e) {22 public <E> void accept (ExprVisitorWithEnv<E> v, E e) { 23 23 v.visit(this, e); 24 24 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstObjDecl.java
r3566 r3570 32 32 return "$" + kind.name().toLowerCase() + " " + qname + ";"; 33 33 } 34 35 @Override 36 public String toString () { 37 return (isPublic ? "$public " : "") + "$" + kind.name().toLowerCase() + " " + name + ";"; 38 } 34 39 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstParen.java
r3566 r3570 4 4 5 5 public final class AstParen extends AstTerm { 6 public final AstExpr exp ;6 public final AstExpr expr; 7 7 8 public AstParen (SrcPosition pos, AstExpr exp ) {8 public AstParen (SrcPosition pos, AstExpr expr) { 9 9 super(pos); 10 assert exp != null;11 this.exp = exp;10 assert expr != null; 11 this.expr = expr; 12 12 } 13 13 14 14 @Override 15 public void accept (Exp Visitor v) {15 public void accept (ExprVisitor v) { 16 16 v.visit(this); 17 17 } 18 18 19 19 @Override 20 public <E> void accept (Exp VisitorWithEnv<E> v, E e) {20 public <E> void accept (ExprVisitorWithEnv<E> v, E e) { 21 21 v.visit(this, e); 22 22 } … … 24 24 @Override 25 25 public String toString () { 26 return "(" + exp .toString() + ")";26 return "(" + expr.toString() + ")"; 27 27 } 28 28 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstPattern.java
r3566 r3570 13 13 14 14 public final MatchDir dir; 15 public final AstExpr exp ;15 public final AstExpr expr; 16 16 17 public AstPattern (SrcPosition pos, MatchDir dir, AstExpr exp ) {17 public AstPattern (SrcPosition pos, MatchDir dir, AstExpr expr) { 18 18 super(pos); 19 assert dir != null && exp != null;19 assert dir != null && expr != null; 20 20 this.dir = dir; 21 this.exp = exp;21 this.expr = expr; 22 22 } 23 23 … … 31 31 v.visit(this, e); 32 32 } 33 34 @Override 35 public String toString () { 36 return (": " + dir.select("", "$r ") + expr).trim(); 37 } 33 38 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstRef.java
r3566 r3570 15 15 16 16 @Override 17 public void accept (Exp Visitor v) {17 public void accept (ExprVisitor v) { 18 18 v.visit(this); 19 19 } 20 20 21 21 @Override 22 public <E> void accept (Exp VisitorWithEnv<E> v, E e) {22 public <E> void accept (ExprVisitorWithEnv<E> v, E e) { 23 23 v.visit(this, e); 24 24 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstResult.java
r3566 r3570 4 4 5 5 public final class AstResult extends AstStatement { 6 public final AstExpr exp ;6 public final AstExpr expr; 7 7 8 public AstResult (SrcPosition pos, AstExpr exp ) {8 public AstResult (SrcPosition pos, AstExpr expr) { 9 9 super(pos); 10 assert exp != null;11 this.exp = exp;10 assert expr != null; 11 this.expr = expr; 12 12 } 13 13 … … 21 21 v.visit(this, e); 22 22 } 23 24 @Override 25 public String toString () { 26 return (", " + expr).trim(); 27 } 23 28 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstSentence.java
r3566 r3570 19 19 v.visit(this, e); 20 20 } 21 22 @Override 23 public String toString () { 24 StringBuffer strBuf = new StringBuffer(); 25 boolean flag = false; 26 for (AstStatement statement : statementList) { 27 if (flag) 28 strBuf.append(' '); 29 strBuf.append(statement); 30 flag = true; 31 } 32 return strBuf.toString().trim(); 33 } 21 34 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstTerm.java
r3566 r3570 8 8 } 9 9 10 public abstract void accept (Exp Visitor v);10 public abstract void accept (ExprVisitor v); 11 11 12 public abstract <E> void accept (Exp VisitorWithEnv<E> v, E e);12 public abstract <E> void accept (ExprVisitorWithEnv<E> v, E e); 13 13 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstTraceAll.java
r3566 r3570 17 17 v.visit(this, e); 18 18 } 19 20 @Override 21 public String toString () { 22 return "$traceall;"; 23 } 19 24 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstTrap.java
r3566 r3570 23 23 v.visit(this, e); 24 24 } 25 26 @Override 27 public String toString () { 28 return (("$trap " + trySentence).trim() + " $with " + catchSentence).trim(); 29 } 25 30 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstUse.java
r3566 r3570 21 21 v.visit(this, e); 22 22 } 23 24 @Override 25 public String toString () { 26 return "$use " + name + ";"; 27 } 23 28 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstVar.java
r3566 r3570 45 45 46 46 @Override 47 public void accept (Exp Visitor v) {47 public void accept (ExprVisitor v) { 48 48 v.visit(this); 49 49 } 50 50 51 51 @Override 52 public <E> void accept (Exp VisitorWithEnv<E> v, E e) {52 public <E> void accept (ExprVisitorWithEnv<E> v, E e) { 53 53 v.visit(this, e); 54 54 } 55 55 56 // public String getText () { 57 // if (name != null) 58 // return type.name().toLowerCase() + (pos.charStart + 1 < name.pos.charStart ? "." : "") + name.identifier; 59 // else 60 // return type.name().toLowerCase() + (pos.length() > 1 ? "." : ""); 61 // } 62 56 63 @Override 57 64 public String toString () { 58 if (name != null) 59 return type.name().toLowerCase() + (pos.charStart + 1 < name.pos.charStart ? "." : "") + name.identifier; 60 else 61 return type.name().toLowerCase() + (pos.length() > 1 ? "." : ""); 65 return type.name().toLowerCase() + (name == null ? "" : "." + name.identifier); 62 66 } 63 67 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/AstWordSymbol.java
r3566 r3570 13 13 14 14 @Override 15 public void accept (Exp Visitor v) {15 public void accept (ExprVisitor v) { 16 16 v.visit(this); 17 17 } 18 18 19 19 @Override 20 public <E> void accept (Exp VisitorWithEnv<E> v, E e) {20 public <E> void accept (ExprVisitorWithEnv<E> v, E e) { 21 21 v.visit(this, e); 22 22 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/ExprVisitor.java
r3568 r3570 1 1 package org.refal.rfpdt.ast; 2 2 3 public interface Exp Visitor {3 public interface ExprVisitor { 4 4 void visit (AstCall astCall); 5 5 6 6 void visit (AstCharSymbol astCharSymbol); 7 7 8 void visit (AstExpr astExp );8 void visit (AstExpr astExpr); 9 9 10 10 void visit (AstNumberSymbol astNumberSymbol); -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/ExprVisitorWithEnv.java
r3568 r3570 1 1 package org.refal.rfpdt.ast; 2 2 3 public interface Exp VisitorWithEnv<E> {3 public interface ExprVisitorWithEnv<E> { 4 4 void visit (AstCall astCall, E e); 5 5 6 6 void visit (AstCharSymbol astCharSymbol, E e); 7 7 8 void visit (AstExpr astExp , E e);8 void visit (AstExpr astExpr, E e); 9 9 10 10 void visit (AstNumberSymbol astNumberSymbol, E e); -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/ast/Searcher.java
r3566 r3570 3 3 import java.util.ArrayList; 4 4 5 public class Searcher implements ProgramVisitor, SentenceVisitor, Exp Visitor {5 public class Searcher implements ProgramVisitor, SentenceVisitor, ExprVisitor { 6 6 public static ArrayList<AstNode> search (AstImplem astImplem, int offset) { 7 7 Searcher search = new Searcher(offset); … … 37 37 return; 38 38 visit(astConstBinding.name); 39 astConstBinding.exp .accept(this);39 astConstBinding.expr.accept(this); 40 40 } 41 41 … … 127 127 if (!check(astFormat)) 128 128 return; 129 astFormat.exp .accept(this);129 astFormat.expr.accept(this); 130 130 } 131 131 … … 146 146 if (!check(astPattern)) 147 147 return; 148 astPattern.exp .accept(this);148 astPattern.expr.accept(this); 149 149 } 150 150 … … 152 152 if (!check(astResult)) 153 153 return; 154 astResult.exp .accept(this);154 astResult.expr.accept(this); 155 155 } 156 156 … … 182 182 } 183 183 184 public void visit (AstExpr astExp ) {185 if (!check(astExp ))186 return; 187 for (AstTerm astTerm : astExp .termList)184 public void visit (AstExpr astExpr) { 185 if (!check(astExpr)) 186 return; 187 for (AstTerm astTerm : astExpr.termList) 188 188 astTerm.accept(this); 189 189 } … … 196 196 if (!check(astParen)) 197 197 return; 198 astParen.exp .accept(this);198 astParen.expr.accept(this); 199 199 } 200 200 -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/compiler/ExpChecker.java
r3566 r3570 34 34 import org.refal.rfpdt.ast.AstVar; 35 35 import org.refal.rfpdt.ast.AstWordSymbol; 36 import org.refal.rfpdt.ast.Exp VisitorWithEnv;36 import org.refal.rfpdt.ast.ExprVisitorWithEnv; 37 37 import org.refal.rfpdt.ast.ProgramVisitor; 38 38 import org.refal.rfpdt.ast.SentenceVisitor; … … 53 53 } 54 54 55 private final class FormatChecker implements Exp VisitorWithEnv<ContainerWithVar> {55 private final class FormatChecker implements ExprVisitorWithEnv<ContainerWithVar> { 56 56 public void visit (AstCall astCall, ContainerWithVar e) { 57 57 msgHandler.send(astCall.pos, MsgCode.UnexpectedFunctionCallInFormat); … … 71 71 72 72 public void visit (AstParen astParen, ContainerWithVar e) { 73 astParen.exp .accept(this, e);73 astParen.expr.accept(this, e); 74 74 } 75 75 … … 78 78 e.noError = false; 79 79 if (astRef.decl instanceof AstConstBinding) 80 e.noError &= ((AstConstBinding) astRef.decl).exp .noError;80 e.noError &= ((AstConstBinding) astRef.decl).expr.noError; 81 81 } 82 82 … … 94 94 } 95 95 96 private final class PatternChecker implements Exp VisitorWithEnv<Container> {96 private final class PatternChecker implements ExprVisitorWithEnv<Container> { 97 97 public void visit (AstCall astCall, Container e) { 98 98 msgHandler.send(astCall.pos, MsgCode.UnexpectedFunctionCallInPattern); … … 110 110 111 111 public void visit (AstParen astParen, Container e) { 112 astParen.exp .accept(this, e);112 astParen.expr.accept(this, e); 113 113 } 114 114 … … 116 116 e.noError &= astRef.decl != null; 117 117 if (astRef.decl instanceof AstConstBinding) 118 e.noError &= ((AstConstBinding) astRef.decl).exp .noError;118 e.noError &= ((AstConstBinding) astRef.decl).expr.noError; 119 119 } 120 120 … … 124 124 } 125 125 126 private final class ResultChecker implements Exp VisitorWithEnv<Container> {126 private final class ResultChecker implements ExprVisitorWithEnv<Container> { 127 127 public void visit (AstCall astCall, Container e) { 128 128 checkResult(astCall.arg); … … 140 140 141 141 public void visit (AstParen astParen, Container e) { 142 astParen.exp .accept(this, e);142 astParen.expr.accept(this, e); 143 143 } 144 144 … … 146 146 e.noError &= astRef.decl != null; 147 147 if (astRef.decl instanceof AstConstBinding) 148 e.noError &= ((AstConstBinding) astRef.decl).exp .noError;148 e.noError &= ((AstConstBinding) astRef.decl).expr.noError; 149 149 } 150 150 … … 181 181 182 182 public void visit (AstConstBinding astConstBinding) { 183 checkFormat(astConstBinding.exp );183 checkFormat(astConstBinding.expr); 184 184 } 185 185 … … 236 236 237 237 public void visit (AstFormat astFormat) { 238 checkFormat(astFormat.exp );238 checkFormat(astFormat.expr); 239 239 } 240 240 … … 249 249 250 250 public void visit (AstPattern astPattern) { 251 checkPattern(astPattern.exp );251 checkPattern(astPattern.expr); 252 252 } 253 253 254 254 public void visit (AstResult astResult) { 255 checkResult(astResult.exp );255 checkResult(astResult.expr); 256 256 } 257 257 -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/compiler/FormatChecker.java
r3566 r3570 34 34 import org.refal.rfpdt.ast.AstVar; 35 35 import org.refal.rfpdt.ast.AstWordSymbol; 36 import org.refal.rfpdt.ast.Exp Visitor;36 import org.refal.rfpdt.ast.ExprVisitor; 37 37 import org.refal.rfpdt.ast.ProgramVisitor; 38 38 import org.refal.rfpdt.ast.SentenceVisitor; … … 40 40 41 41 public class FormatChecker implements ProgramVisitor, SentenceVisitor, SentenceVisitorWithEnv<FormatChecker.RefAstExp>, 42 Exp Visitor {42 ExprVisitor { 43 43 private static final class RefAstExp { 44 44 public AstExpr exp; … … 171 171 172 172 public void visit (AstPattern astPattern) { 173 covers(inFormat, astPattern.exp , MsgCode.WrongFormatOfPatternExpression);173 covers(inFormat, astPattern.expr, MsgCode.WrongFormatOfPatternExpression); 174 174 } 175 175 … … 211 211 212 212 public void visit (AstFormat astFormat, RefAstExp e) { 213 e.set(astFormat.exp , MsgCode.FormatMismatch);213 e.set(astFormat.expr, MsgCode.FormatMismatch); 214 214 } 215 215 … … 231 231 232 232 public void visit (AstResult astResult, RefAstExp e) { 233 covers(e.exp, astResult.exp , e.msgCode);234 astResult.exp .accept(this);233 covers(e.exp, astResult.expr, e.msgCode); 234 astResult.expr.accept(this); 235 235 e.reset(); 236 236 } … … 257 257 public void visit (AstCharSymbol astCharSymbol) {} 258 258 259 public void visit (AstExpr astExp ) {260 for (AstTerm astTerm : astExp .termList)259 public void visit (AstExpr astExpr) { 260 for (AstTerm astTerm : astExpr.termList) 261 261 astTerm.accept(this); 262 262 } … … 265 265 266 266 public void visit (AstParen astParen) { 267 astParen.exp .accept(this);267 astParen.expr.accept(this); 268 268 } 269 269 -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/compiler/FormatMatcher.java
r3566 r3570 15 15 import org.refal.rfpdt.ast.AstVar; 16 16 import org.refal.rfpdt.ast.AstWordSymbol; 17 import org.refal.rfpdt.ast.Exp Visitor;18 import org.refal.rfpdt.ast.Exp VisitorWithEnv;17 import org.refal.rfpdt.ast.ExprVisitor; 18 import org.refal.rfpdt.ast.ExprVisitorWithEnv; 19 19 import org.refal.rfpdt.ast.AstVar.VarType; 20 20 … … 29 29 30 30 @Override 31 public void accept (Exp Visitor v) {31 public void accept (ExprVisitor v) { 32 32 throw new UnsupportedOperationException(); 33 33 } 34 34 35 35 @Override 36 public <E> void accept (Exp VisitorWithEnv<E> v, E e) {36 public <E> void accept (ExprVisitorWithEnv<E> v, E e) { 37 37 throw new UnsupportedOperationException(); 38 38 } … … 76 76 if (astDecl instanceof AstConstBinding) { 77 77 AstConstBinding astConstBinding = (AstConstBinding) astDecl; 78 return astConstBinding.exp .termList;78 return astConstBinding.expr.termList; 79 79 } else { 80 80 AstTerm[] list = { new AstRefSymbol(astRef) }; … … 96 96 return false; 97 97 else 98 return covers(((AstParen) f).exp , ((AstParen) e).exp);98 return covers(((AstParen) f).expr, ((AstParen) e).expr); 99 99 } else if (isVar(VarType.S, f)) { 100 100 return (e instanceof AstSymbol) || (isVar(VarType.S, e)); -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/compiler/NameChecker.java
r3566 r3570 40 40 import org.refal.rfpdt.ast.AstVar; 41 41 import org.refal.rfpdt.ast.AstWordSymbol; 42 import org.refal.rfpdt.ast.Exp Visitor;42 import org.refal.rfpdt.ast.ExprVisitor; 43 43 import org.refal.rfpdt.ast.ProgramVisitor; 44 44 import org.refal.rfpdt.ast.SentenceVisitor; 45 45 import org.refal.rfpdt.ast.AstObjDecl.ObjKind; 46 46 47 public final class NameChecker implements ProgramVisitor, SentenceVisitor, Exp Visitor {47 public final class NameChecker implements ProgramVisitor, SentenceVisitor, ExprVisitor { 48 48 public static void check (AstImplem astImplem, MsgHandler msgHandler) { 49 49 NameChecker v = new NameChecker(msgHandler, astImplem.moduleName); … … 191 191 192 192 public void visit (AstConstBinding astConstBinding) { 193 astConstBinding.exp .accept(this);193 astConstBinding.expr.accept(this); 194 194 } 195 195 … … 284 284 285 285 public void visit (AstFormat astFormat) { 286 astFormat.exp .accept(this);286 astFormat.expr.accept(this); 287 287 } 288 288 … … 298 298 299 299 public void visit (AstPattern astPattern) { 300 astPattern.exp .accept(this);300 astPattern.expr.accept(this); 301 301 } 302 302 303 303 public void visit (AstResult astResult) { 304 astResult.exp .accept(this);304 astResult.expr.accept(this); 305 305 } 306 306 … … 333 333 334 334 public void visit (AstParen astParen) { 335 astParen.exp .accept(this);335 astParen.expr.accept(this); 336 336 } 337 337 -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/compiler/RefalASGenerator.java
r3568 r3570 39 39 import org.refal.rfpdt.ast.AstVar; 40 40 import org.refal.rfpdt.ast.AstWordSymbol; 41 import org.refal.rfpdt.ast.Exp VisitorWithEnv;41 import org.refal.rfpdt.ast.ExprVisitorWithEnv; 42 42 import org.refal.rfpdt.ast.ProgramVisitorWithEnv; 43 43 import org.refal.rfpdt.ast.SentenceVisitorWithEnv; 44 44 45 45 public class RefalASGenerator implements ProgramVisitorWithEnv<Expr.Concatenator>, 46 SentenceVisitorWithEnv<Expr.Concatenator>, Exp VisitorWithEnv<Expr.Concatenator> {46 SentenceVisitorWithEnv<Expr.Concatenator>, ExprVisitorWithEnv<Expr.Concatenator> { 47 47 private static final String MODULE = "MODULE"; 48 48 private static final String IMPORT = "IMPORT"; … … 110 110 String modName = astConstBinding.module != null ? astConstBinding.module : moduleName; 111 111 items.toRight(makeName(modName + "." + astConstBinding.name.identifier)); 112 astConstBinding.exp .accept(this, items);112 astConstBinding.expr.accept(this, items); 113 113 e.toRight((Comparable<?>) items.yield()); 114 114 } … … 247 247 Expr.Concatenator format = Expr.getConcatenator(); 248 248 format.toRight(FORMAT); 249 astFormat.exp .accept(this, format);249 astFormat.expr.accept(this, format); 250 250 e.toRight((Comparable<?>) format.yield()); 251 251 } … … 278 278 Expr.Concatenator items = Expr.getConcatenator(); 279 279 items.toRight(astPattern.dir.select(LEFT, RIGHT)); 280 astPattern.exp .accept(this, items);280 astPattern.expr.accept(this, items); 281 281 e.toRight((Comparable<?>) items.yield()); 282 282 } … … 286 286 Expr.Concatenator items = Expr.getConcatenator(); 287 287 items.toRight(RESULT); 288 astResult.exp .accept(this, items);288 astResult.expr.accept(this, items); 289 289 e.toRight((Comparable<?>) items.yield()); 290 290 } … … 340 340 Expr.Concatenator items = Expr.getConcatenator(); 341 341 items.toRight(PAREN); 342 astParen.exp .accept(this, items);342 astParen.expr.accept(this, items); 343 343 e.toRight((Comparable<?>) items.yield()); 344 344 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/compiler/VariableScopeChecker.java
r3566 r3570 38 38 import org.refal.rfpdt.ast.AstVar; 39 39 import org.refal.rfpdt.ast.AstWordSymbol; 40 import org.refal.rfpdt.ast.Exp VisitorWithEnv;40 import org.refal.rfpdt.ast.ExprVisitorWithEnv; 41 41 import org.refal.rfpdt.ast.ProgramVisitor; 42 42 import org.refal.rfpdt.ast.SentenceVisitorWithEnv; … … 44 44 public final class VariableScopeChecker implements ProgramVisitor, 45 45 SentenceVisitorWithEnv<VariableScopeChecker.LexicalEnvironment>, 46 Exp VisitorWithEnv<VariableScopeChecker.VarVisitor> {46 ExprVisitorWithEnv<VariableScopeChecker.VarVisitor> { 47 47 48 48 private static final class LexicalEnvironment { … … 212 212 213 213 public void visit (AstFormat astFormat, LexicalEnvironment e) { 214 astFormat.exp .accept(this, new DefineVarVisitor(e));214 astFormat.expr.accept(this, new DefineVarVisitor(e)); 215 215 } 216 216 … … 225 225 226 226 public void visit (AstPattern astPattern, LexicalEnvironment e) { 227 astPattern.exp .accept(this, new AddVarVisitor(e));227 astPattern.expr.accept(this, new AddVarVisitor(e)); 228 228 } 229 229 230 230 public void visit (AstResult astResult, LexicalEnvironment e) { 231 astResult.exp .accept(this, new CheckVarVisitor(e));231 astResult.expr.accept(this, new CheckVarVisitor(e)); 232 232 } 233 233 … … 259 259 260 260 public void visit (AstParen astParen, VarVisitor e) { 261 astParen.exp .accept(this, e);261 astParen.expr.accept(this, e); 262 262 } 263 263 -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/parser/RfpCharacter.java
r3566 r3570 4 4 public static boolean isIdStartChar (int c) { 5 5 return ('A' <= c && c <= 'Z') || c == '_'; 6 } 7 8 public static boolean isIdInternalChar (int c) { 9 return isAlphanum(c) || c == '.'; 6 10 } 7 11 -
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/parser/RfpScanner.java
r3566 r3570 341 341 sb.append((char) ch); 342 342 nextCh(); 343 while (RfpCharacter.is Alphanum(ch) || ch == '.') {343 while (RfpCharacter.isIdInternalChar(ch)) { 344 344 sb.append((char) ch); 345 345 nextCh(); -
devel-tools/trunk/eclipse/org.refal.rfpdt.test/src/org/refal/rfpdt/test/comp/ParserTest.java
r3566 r3570 9 9 import org.refal.rfpdt.ast.AstImplem; 10 10 import org.refal.rfpdt.ast.AstInterf; 11 import org.refal.rfpdt.ast.ImageBuilder;12 11 import org.refal.rfpdt.compiler.MsgCode; 13 12 … … 23 22 AstInterf astInterf = Util.parseInterfString(input, msgAcc); 24 23 assertTrue("Syntax is OK", msgAcc.messages.isEmpty()); 25 String actual = ImageBuilder.getImage(astInterf);24 String actual = astInterf.toString(); 26 25 assertEquals("AST is OK", expected, actual); 27 26 } … … 31 30 AstImplem astImplem = Util.parseImplemString(input, msgAcc); 32 31 assertTrue("Syntax is OK", msgAcc.messages.isEmpty()); 33 String actual = ImageBuilder.getImage(astImplem);32 String actual = astImplem.toString(); 34 33 assertEquals("AST is OK", expected, actual); 35 34 } … … 45 44 public void parseModuleInterface () { 46 45 interf("$const;", ""); 47 interf("$const A = 1;", "$public $const A = 1 ;");48 interf("$const A = 1, B = 2;", "$public $const A = 1 ; $public $const B = 2 ;");49 interf("$const A = A \"x x\" 123 ( & B );", "$public $const A = A \"x x\" 123 ( & B ) ;");46 interf("$const A = 1;", "$public $const A = 1;"); 47 interf("$const A = 1, B = 2;", "$public $const A = 1; $public $const B = 2;"); 48 interf("$const A = A \"x x\" 123 ( & B );", "$public $const A = A \"x x\" 123 (&B);"); 50 49 51 50 interf("$box;", ""); 52 interf("$box A;", "$public $box A ;");53 interf("$box A B;", "$public $box A ; $public $box B ;");51 interf("$box A;", "$public $box A;"); 52 interf("$box A B;", "$public $box A; $public $box B;"); 54 53 55 54 interf("$vector;", ""); 56 interf("$vector A;", "$public $vector A ;");57 interf("$vector A B;", "$public $vector A ; $public $vector B ;");55 interf("$vector A;", "$public $vector A;"); 56 interf("$vector A B;", "$public $vector A; $public $vector B;"); 58 57 59 58 interf("$string;", ""); 60 interf("$string A;", "$public $string A ;");61 interf("$string A B;", "$public $string A ; $public $string B ;");59 interf("$string A;", "$public $string A;"); 60 interf("$string A B;", "$public $string A; $public $string B;"); 62 61 63 62 interf("$table;", ""); 64 interf("$table A;", "$public $table A ;");65 interf("$table A B;", "$public $table A ; $public $table B ;");63 interf("$table A;", "$public $table A;"); 64 interf("$table A B;", "$public $table A; $public $table B;"); 66 65 67 66 interf("$channel;", ""); 68 interf("$channel A;", "$public $channel A ;");69 interf("$channel A B;", "$public $channel A ; $public $channel B ;");67 interf("$channel A;", "$public $channel A;"); 68 interf("$channel A B;", "$public $channel A; $public $channel B;"); 70 69 71 interf("$func F s (e t) = sX (eY tZ);", "$public $func F s ( e t ) = sX ( eY tZ ) ;");72 interf("$func? F s (e t) = s.X (e.Y t.Z) ;", "$public $func? F s ( e t ) = s.X ( e.Y t.Z ) ;");70 interf("$func F s (e t) = sX (eY tZ);", "$public $func F s (e t) = s.X (e.Y t.Z);"); 71 interf("$func? F s (e t) = s.X (e.Y t.Z) ;", "$public $func? F s (e t) = s.X (e.Y t.Z);"); 73 72 74 interf("$module A.B.C;", "$module A.B.C ; "); 73 interf("$module A.B.C;", "$module A.B.C;"); 74 interf("$module \"A.B.C\";", "$module A.B.C;"); 75 interf("$module \"a.B.C\";", "$module \"a.B.C\";"); 75 76 } 76 77 … … 78 79 public void parseModuleImplementation () { 79 80 implem("$use;", ""); 80 implem("$use A;", "$use A ;");81 implem("$use A B;", "$use A ; $use B ;");81 implem("$use A;", "$use A;"); 82 implem("$use A B;", "$use A; $use B;"); 82 83 83 84 implem("$const;", ""); 84 implem("$const A = 1;", "$const A = 1 ;");85 implem("$const A = 1, B = 2;", "$const A = 1 ; $const B = 2 ;");86 implem("$const A = A \"x x\" ( &B );", "$const A = A \"x x\" ( & B ) ;");85 implem("$const A = 1;", "$const A = 1;"); 86 implem("$const A = 1, B = 2;", "$const A = 1; $const B = 2;"); 87 implem("$const A = A \"x x\" ( &B );", "$const A = A \"x x\" (&B);"); 87 88 88 89 implem("$box;", ""); 89 implem("$box A;", "$box A ;");90 implem("$box A B;", "$box A ; $box B ;");90 implem("$box A;", "$box A;"); 91 implem("$box A B;", "$box A; $box B;"); 91 92 92 93 implem("$vector;", ""); 93 implem("$vector A;", "$vector A ;");94 implem("$vector A B;", "$vector A ; $vector B ;");94 implem("$vector A;", "$vector A;"); 95 implem("$vector A B;", "$vector A; $vector B;"); 95 96 96 97 implem("$string;", ""); 97 implem("$string A;", "$string A ;");98 implem("$string A B;", "$string A ; $string B ;");98 implem("$string A;", "$string A;"); 99 implem("$string A B;", "$string A; $string B;"); 99 100 100 101 implem("$table;", ""); 101 implem("$table A;", "$table A ;");102 implem("$table A B;", "$table A ; $table B ;");102 implem("$table A;", "$table A;"); 103 implem("$table A B;", "$table A; $table B;"); 103 104 104 105 implem("$channel;", ""); 105 implem("$channel A;", "$channel A ;");106 implem("$channel A B;", "$channel A ; $channel B ;");106 implem("$channel A;", "$channel A;"); 107 implem("$channel A B;", "$channel A; $channel B;"); 107 108 108 109 implem("$func F s (e t) 123 A \"A b\" ( &B ) = sX (eY tZ);", 109 "$func F s ( e t ) 123 A \"A b\" ( & B ) = sX ( eY tZ ) ;");110 implem("$func? F s = t;", "$func? F s = t ;");110 "$func F s (e t) 123 A \"A b\" (&B) = s.X (e.Y t.Z);"); 111 implem("$func? F s = t;", "$func? F s = t;"); 111 112 112 113 implem("$trace;", ""); 113 implem("$trace A;", "$trace A ;");114 implem("$trace A B;", "$trace A ; $trace B ;");114 implem("$trace A;", "$trace A;"); 115 implem("$trace A B;", "$trace A; $trace B;"); 115 116 116 implem("$traceall;", "$traceall; 117 implem("$traceall;", "$traceall;"); 117 118 118 implem("\"F\" {};", "F { } ;");119 implem("\"F\" {};", "F {} ;"); 119 120 120 implem("$use A B C; F {};", "$use A ; $use B ; $use C ; F { } ;");121 implem("$use A B C; F {};", "$use A; $use B; $use C; F {} ;"); 121 122 122 implem("F;", "F : , ; 123 implem("F sX;", "F : s X , ;");123 implem("F;", "F : , ;"); 124 implem("F sX;", "F : s.X , ;"); 124 125 implem("F s t e v sX1_ t2X_ eX3_ v_X4 s.X1_ t.2X_ e.X3_ v._X4;", 125 "F : s t e v sX1_ t2X_ eX3_ v_X4 s.X1_ t.2X_ e.X3_ v._X4 , ; "); 126 implem("F $l s;", "F : s , ; "); 127 implem("F $r s;", "F : $r s , ; "); 126 "F : s t e v s.X1_ t.2X_ e.X3_ v._X4 s.X1_ t.2X_ e.X3_ v._X4 , ;"); 127 implem("F $l s;", "F : s , ;"); 128 implem("F $r s;", "F : $r s , ;"); 129 implem("F $r;", "F : $r , ;"); 128 130 129 implem("F A;", "F : A , ; "); 130 implem("F s1, s1 : A;", "F : s1 , s1 : A , ; "); 131 implem("F {A; B;};", "F { : A , ; : B , ; } ; "); 132 implem("F {};", "F { } ; "); 133 implem("F {;};", "F { : , ; } ; "); 134 implem("F {A;};", "F { : A , ; } ; "); 135 implem("F \\{A; B;};", "F \\{ : A , ; : B , ; } ; "); 131 implem("F A;", "F : A , ;"); 132 implem("F s1, s1 : A;", "F : s.1 , s.1 : A , ;"); 133 implem("F {A; B;};", "F { : A , ; : B , ; } ;"); 134 implem("F {};", "F {} ;"); 135 implem("F {;};", "F { : , ; } ;"); 136 implem("F {A;};", "F { : A , ; } ;"); 137 implem("F \\{A; B;};", "F \\{ : A , ; : B , ; } ;"); 138 implem("F, {};", "F : {} ;"); 139 implem("F, {;};", "F : { , ; } ;"); 140 implem("F, {A;};", "F : { , A ; } ;"); 141 implem("F, \\{A; B;};", "F : \\{ , A ; , B ; } ;"); 136 142 137 143 implem("F = sX1_ t2X_ eX3_ v_X4 s.X1_ t.2X_ e.X3_ v._X4;", 138 "F : = , s X1_ t2X_ eX3_ v_X4 s.X1_ t.2X_ e.X3_ v._X4 ;");139 implem("F = sX <F (e2) A> ;", "F : = , sX < F ( e2 ) A > ;");144 "F : = , s.X1_ t.2X_ e.X3_ v._X4 s.X1_ t.2X_ e.X3_ v._X4 ;"); 145 implem("F = sX <F (e2) A> ;", "F : = , s.X <F (e.2) A> ;"); 140 146 141 implem("F , eX;", "F : , e X ;");142 implem("F , A:: ;", "F : , A :: , ; 143 implem("F , A::s, B;", "F : , A :: s , B ; 144 implem("F , A $iter B;", "F : , A $iter , B :: , ; 145 implem("F , A $iter B,;", "F : , A $iter , B :: , ; 146 implem("F , A $iter B :: s;", "F : , A $iter , B :: s , ; 147 implem("F , A $iter B :: s,;", "F : , A $iter , B :: s , ; 148 implem("F , A : sX;", "F : , A : s X , ;");149 implem("F , A : sX,;", "F : , A : s X , ;");147 implem("F , eX;", "F : , e.X ;"); 148 implem("F , A:: ;", "F : , A :: , ;"); 149 implem("F , A::s, B;", "F : , A :: s , B ;"); 150 implem("F , A $iter B;", "F : , A $iter , B :: , ;"); 151 implem("F , A $iter B,;", "F : , A $iter , B :: , ;"); 152 implem("F , A $iter B :: s;", "F : , A $iter , B :: s , ;"); 153 implem("F , A $iter B :: s,;", "F : , A $iter , B :: s , ;"); 154 implem("F , A : sX;", "F : , A : s.X , ;"); 155 implem("F , A : sX,;", "F : , A : s.X , ;"); 150 156 151 implem("F , , A;", "F : , :: , A ; 152 implem("F , #{;};", "F : , :: # { , ; } :: , ; 153 implem("F , #{;},A;", "F : , :: # { , ; } :: , A ; 154 implem("F , \\? A;", "F : , :: \\? , A ; 155 implem("F , \\! A;", "F : , :: \\! , A ; 156 implem("F , $fail;", "F : , :: $fail ; 157 implem("F , = A;", "F : , :: = , A ; 158 implem("F , $error A;", "F : , :: $error , A ; 159 implem("F , $trap A $with { A,; B,; };", "F : , :: $trap , A $with { : A , ; : B , ; } ; 160 implem("F , $trap A $with \\{ A,; B,; };", "F : , :: $trap , A $with \\{ : A , ; : B , ; } ; 157 implem("F , , A;", "F : , :: , A ;"); 158 implem("F , #{;};", "F : , :: # { , ; } :: , ;"); 159 implem("F , #{;},A;", "F : , :: # { , ; } :: , A ;"); 160 implem("F , \\? A;", "F : , :: \\? , A ;"); 161 implem("F , \\! A;", "F : , :: \\! , A ;"); 162 implem("F , $fail;", "F : , :: $fail ;"); 163 implem("F , = A;", "F : , :: = , A ;"); 164 implem("F , $error A;", "F : , :: $error , A ;"); 165 implem("F , $trap A $with { A,; B,; };", "F : , :: $trap , A $with { : A , ; : B , ; } ;"); 166 implem("F , $trap A $with \\{ A,; B,; };", "F : , :: $trap , A $with \\{ : A , ; : B , ; } ;"); 161 167 162 implem("F , #A;", "F : , :: # , A :: , ; 163 implem("F , #;", "F : , :: # , :: , ; 164 implem("F , #{A; B;};", "F : , :: # { , A ; , B ; } :: , ; 165 implem("F , #\\{A; B;};", "F : , :: # \\{ , A ; , B ; } :: , ; 166 implem("F , #A : {A,1;B,2;};", "F : , :: # , A { : A , 1 ; : B , 2 ; } :: , ; 167 implem("F , #A : \\{A,1;B,2;};", "F : , :: # , A \\{ : A , 1 ; : B , 2 ; } :: , ; 168 implem("F , #A;", "F : , :: # , A :: , ;"); 169 implem("F , #;", "F : , :: # , :: , ;"); 170 implem("F , #{A; B;};", "F : , :: # { , A ; , B ; } :: , ;"); 171 implem("F , #\\{A; B;};", "F : , :: # \\{ , A ; , B ; } :: , ;"); 172 implem("F , #A : {A,1;B,2;};", "F : , :: # , A { : A , 1 ; : B , 2 ; } :: , ;"); 173 implem("F , #A : \\{A,1;B,2;};", "F : , :: # , A \\{ : A , 1 ; : B , 2 ; } :: , ;"); 168 174 implem("F , #A : {A,1;B,2;} : {A,1;B,2;};", 169 "F : , :: # , A { : A , 1 ; : B , 2 ; } { : A , 1 ; : B , 2 ; } :: , ; 175 "F : , :: # , A { : A , 1 ; : B , 2 ; } { : A , 1 ; : B , 2 ; } :: , ;"); 170 176 implem("F , A : {A,1;B,2;} : {A,1;B,2;} :: sX, sX;", 171 "F : , A { : A , 1 ; : B , 2 ; } { : A , 1 ; : B , 2 ; } :: s X , sX ;");177 "F : , A { : A , 1 ; : B , 2 ; } { : A , 1 ; : B , 2 ; } :: s.X , s.X ;"); 172 178 implem("F , A : {$fail;A;} : {A,1;B,2;} :: sX, sX;", 173 "F : , A { : $fail ; : A , ; } { : A , 1 ; : B , 2 ; } :: s X , sX ;");179 "F : , A { : $fail ; : A , ; } { : A , 1 ; : B , 2 ; } :: s.X , s.X ;"); 174 180 175 implem("F { {}; };", "F { { } ; } ;");176 implem("F { { A = B; } :: sX; };", "F { { : A = , B ; } :: s X , ; } ;");181 implem("F { {}; };", "F { {} ; } ;"); 182 implem("F { { A = B; } :: sX; };", "F { { : A = , B ; } :: s.X , ; } ;"); 177 183 178 implem("F A,A;", "F : A , A ; 179 implem("F #A,A;", "F : # , A :: , A ; 180 implem("F {A,A;};", "F { : A , A ; } ; 181 implem("F {#A,A;};", "F { : # , A :: , A ; } ; 182 implem("F #{A,A;};", "F : # { , A :: , A ; } :: , ; 184 implem("F A,A;", "F : A , A ;"); 185 implem("F #A,A;", "F : # , A :: , A ;"); 186 implem("F {A,A;};", "F { : A , A ; } ;"); 187 implem("F {#A,A;};", "F { : # , A :: , A ; } ;"); 188 implem("F #{A,A;};", "F : # { , A :: , A ; } :: , ;"); 183 189 } 184 190 } -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/PresentationVisitor.java
r3566 r3570 43 43 import org.refal.rfpdt.ast.AstVar; 44 44 import org.refal.rfpdt.ast.AstWordSymbol; 45 import org.refal.rfpdt.ast.Exp Visitor;45 import org.refal.rfpdt.ast.ExprVisitor; 46 46 import org.refal.rfpdt.ast.ProgramVisitor; 47 47 import org.refal.rfpdt.ast.SentenceVisitor; … … 51 51 import org.refal.rfpdt.editor.color.IColorPreferences; 52 52 53 public class PresentationVisitor implements ProgramVisitor, SentenceVisitor, Exp Visitor {53 public class PresentationVisitor implements ProgramVisitor, SentenceVisitor, ExprVisitor { 54 54 public static class StylePosition extends Position { 55 55 private final String key; … … 123 123 public void visit (AstConstBinding astConstBinding) { 124 124 visitObjectDefinition(astConstBinding.name); 125 astConstBinding.exp .accept(this);125 astConstBinding.expr.accept(this); 126 126 } 127 127 … … 188 188 189 189 public void visit (AstFormat astFormat) { 190 astFormat.exp .accept(this);190 astFormat.expr.accept(this); 191 191 } 192 192 … … 201 201 202 202 public void visit (AstPattern astPattern) { 203 astPattern.exp .accept(this);203 astPattern.expr.accept(this); 204 204 } 205 205 206 206 public void visit (AstResult astResult) { 207 astResult.exp .accept(this);207 astResult.expr.accept(this); 208 208 } 209 209 … … 235 235 236 236 public void visit (AstParen astParen) { 237 astParen.exp .accept(this);237 astParen.expr.accept(this); 238 238 } 239 239 -
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/color/IdentifierDetector.java
r3566 r3570 6 6 class IdentifierDetector implements IWordDetector { 7 7 public boolean isWordPart (char c) { 8 return RfpCharacter.is Alphanum(c) || c == '.';8 return RfpCharacter.isIdInternalChar(c); 9 9 } 10 10
Note: See TracChangeset
for help on using the changeset viewer.