Changeset 2250


Ignore:
Timestamp:
Jan 17, 2007, 2:55:08 AM (14 years ago)
Author:
roman
Message:

Name checker

Location:
devel-tools/trunk/eclipse/org.refal.plus.comp/src/org/refal/plus/comp
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.plus.comp/src/org/refal/plus/comp/MsgCode.java

    r2246 r2250  
    33public enum MsgCode { //
    44        CutWithoutAMatchingFence(Severity.Error, "\\! without a matching fence"), //
    5         ExceptionThrown(Severity.Error, "Exception thrown: %s"), //
     5        DuplicateDeclarationOfTheName_X(Severity.Error,
     6                        "Duplicate declaration of the name %s"), //
     7        DuplicateDefinitionOfTheFunction_X(Severity.Error,
     8                        "Duplicate definition of the function %s"), //
     9        ExceptionThrown(Severity.Error, "Exception thrown: %s"), //
    610        ExpectedConstructs(Severity.Error, "Expected constructs: %s"), //
    7         InvalidCharacter(Severity.Error, "Invalid character"), //
     11        Function_X_IsNotDeclared(Severity.Error, "Function %s is not declared"), //
     12        InvalidCharacter(Severity.Error, "Invalid character"), //
    813        InvalidCharacterAfterBS(Severity.Error, "Invalid character after \\"), //
    914        InvalidCharacterAfterBSx(Severity.Error, "Invalid character after \\x"), //
     
    1116        IOExceptionThrown(Severity.Error, "IOException thrown: %s"), //
    1217        MissingToken(Severity.Error, "Missing token: %s"), //
     18        Name_X_IsNotDefined(Severity.Error, "Name %s is not defined"), //
    1319        NoDigitInNumber(Severity.Error, "No digit in number"), //
    1420        NoHexDigitInHexNumber(Severity.Error, "No hex digit in hex number"), //
     
    2329        UnexpectedNewLineInCharacterString(Severity.Error,
    2430                        "Unexpected new line in character string"), //
    25         UnexpectedNewLineInWord(Severity.Error, "Unexpected new line in word"), //
    26         Variable_X_IsNotDefined(Severity.Error, "Variable %s is not defined"), //
    27         WrongSyntax(Severity.Error, "Wrong syntax");
     31        UnexpectedNewLineInWord(Severity.Error, "Unexpected new line in word"), Variable_X_IsNotDefined(Severity.Error, "Variable %s is not defined"), //
     32        WrongSyntax(
     33                        Severity.Error, "Wrong syntax"), //
     34        X_IsNotAFunction(Severity.Error, "%s is not a function");
    2835
    2936        public static enum Severity {
  • devel-tools/trunk/eclipse/org.refal.plus.comp/src/org/refal/plus/comp/VariableCollector.java

    r2244 r2250  
    2222import org.refal.plus.comp.ast.AstMatch;
    2323import org.refal.plus.comp.ast.AstName;
    24 import org.refal.plus.comp.ast.AstNode;
    2524import org.refal.plus.comp.ast.AstNot;
    2625import org.refal.plus.comp.ast.AstNumberSymbol;
     
    125124        }
    126125
    127         public void visit(AstNode astNode) {
    128                 throw new UnsupportedOperationException();
    129         }
    130 
    131126        public void visit(AstNot astNot) {
    132127                throw new UnsupportedOperationException();
  • devel-tools/trunk/eclipse/org.refal.plus.comp/src/org/refal/plus/comp/VariableScopeChecker.java

    r2244 r2250  
    2222import org.refal.plus.comp.ast.PathVisitor;
    2323
    24 public class VariableScopeChecker implements
     24public final class VariableScopeChecker implements
    2525                PathVisitor<LexicalEnvironment<TkAttributes.VarType>> {
    2626
  • devel-tools/trunk/eclipse/org.refal.plus.comp/src/org/refal/plus/comp/ast/AstCall.java

    r2232 r2250  
    1010        public final AstExp arg;
    1111
     12        public AstFuncDecl funcDecl = null;
     13
    1214        public AstCall(AstName name, AstExp arg) {
    1315                this.name = name;
  • devel-tools/trunk/eclipse/org.refal.plus.comp/src/org/refal/plus/comp/ast/AstFuncDecl.java

    r2248 r2250  
    1212        public final AstExp outFormat;
    1313
     14        public AstFuncDef funcDef = null;
     15
    1416        public AstFuncDecl(AstName name, boolean failing, AstExp inFormat,
    1517                        AstExp outFormat) {
  • devel-tools/trunk/eclipse/org.refal.plus.comp/src/org/refal/plus/comp/ast/AstName.java

    r2232 r2250  
    88public final class AstName extends AstNode {
    99
    10         public final String name;
     10        public final String identifier;
    1111
    12         public AstName(SrcPosition pos, String name) {
     12        public AstName(SrcPosition pos, String identifier) {
    1313                this.pos = pos;
    14                 this.name = name;
     14                this.identifier = identifier;
    1515        }
    1616
  • devel-tools/trunk/eclipse/org.refal.plus.comp/src/org/refal/plus/comp/ast/AstPattern.java

    r2206 r2250  
    44package org.refal.plus.comp.ast;
    55
    6 public final class AstPattern {
     6public final class AstPattern extends AstNode {
    77
    88        public final boolean r;
     
    1515        }
    1616
    17         public void accept(NodeVisitor nodeVisitor) {
    18                 nodeVisitor.visit(this);
     17        public void accept(NodeVisitor v) {
     18                v.visit(this);
    1919        }
    2020}
  • devel-tools/trunk/eclipse/org.refal.plus.comp/src/org/refal/plus/comp/ast/AstRef.java

    r2232 r2250  
    66public final class AstRef extends AstTerm {
    77        public final AstName name;
     8       
     9        public AstDecl decl = null;
    810
    911        public AstRef(AstName name) {
  • devel-tools/trunk/eclipse/org.refal.plus.comp/src/org/refal/plus/comp/ast/AstSentence.java

    r2206 r2250  
    44package org.refal.plus.comp.ast;
    55
    6 public final class AstSentence {
     6public final class AstSentence extends AstNode {
    77        public final AstPattern pattern;
    88
     
    1414        }
    1515
    16         public void accept(NodeVisitor nodeVisitor) {
    17                 nodeVisitor.visit(this);
     16        public void accept(NodeVisitor v) {
     17                v.visit(this);
    1818        }
    1919}
  • devel-tools/trunk/eclipse/org.refal.plus.comp/src/org/refal/plus/comp/ast/AstSymbol.java

    r2232 r2250  
    55
    66public abstract class AstSymbol extends AstTerm {
    7 
    8         public void accept(NodeVisitor v) {
    9                 v.visit(this);
    10         }
    117}
  • devel-tools/trunk/eclipse/org.refal.plus.comp/src/org/refal/plus/comp/ast/AstTopNode.java

    r2232 r2250  
    55
    66public abstract class AstTopNode extends AstNode {
    7 
    8         public void accept(NodeVisitor v) {
    9                 v.visit(this);
    10         }
    117}
  • devel-tools/trunk/eclipse/org.refal.plus.comp/src/org/refal/plus/comp/ast/ImageBuilder.java

    r2234 r2250  
    172172
    173173        public void visit(AstName astName) {
    174                 append(astName.name);
    175         }
    176 
    177         public void visit(AstNode astNode) {
    178                 append("???");
     174                append(astName.identifier);
    179175        }
    180176
  • devel-tools/trunk/eclipse/org.refal.plus.comp/src/org/refal/plus/comp/ast/NodeVisitor.java

    r2224 r2250  
    2121        void visit(AstMatch astMatch);
    2222        void visit(AstName astName);
    23         void visit(AstNode astNode);
    2423        void visit(AstNot astNot);
    2524        void visit(AstNumberSymbol astNumberSymbol);
Note: See TracChangeset for help on using the changeset viewer.