Changeset 3454 for devel-tools


Ignore:
Timestamp:
Feb 29, 2008, 7:12:42 PM (13 years ago)
Author:
yura
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.plus.rfpdt/src/org/refal/plus/rfpdt/core/builder/RefalASGenerator.java

    r3444 r3454  
    2020import org.refal.plus.rfpdt.comp.ast.AstIter;
    2121import org.refal.plus.rfpdt.comp.ast.AstNative;
     22import org.refal.plus.rfpdt.comp.ast.AstNode;
    2223import org.refal.plus.rfpdt.comp.ast.AstNot;
    2324import org.refal.plus.rfpdt.comp.ast.AstNumberSymbol;
     
    6869    private static final String FAIL = "FAIL";
    6970    private static final String ERROR = "ERROR";
     71    //private static final String LINENUMBER = "LINENUMBER";
    7072
    7173    private static Expr makeName (String name) {
     
    7577            concat.toRight(str);
    7678        return new Expr(concat.yield());
     79    }
     80   
     81    private static void addLineNumber (AstNode astNode, Expr.Concatenator e) {
     82    // Expr.Concatenator items = Expr.getConcatenator(2);
     83    // items.toRight(LINENUMBER);
     84    // items.toRight(BigInteger.valueOf(astNode.pos.line));
     85    // e.toRight((Comparable<?>) items.yield());
    7786    }
    7887
     
    192201
    193202    public void visit (AstAlt astAlt, Expr.Concatenator e) {
     203        addLineNumber(astAlt, e);
    194204        Expr.Concatenator items = Expr.getConcatenator();
    195205        items.toRight(astAlt.failMode.select(ALT_Q, ALT));
     
    204214
    205215    public void visit (AstCut astCut, Expr.Concatenator e) {
     216        addLineNumber(astCut, e);
    206217        e.toRight((Comparable<?>) new Expr(CUT));
    207218    }
    208219
    209220    public void visit (AstCutAll astCutAll, Expr.Concatenator e) {
     221        addLineNumber(astCutAll, e);
    210222        e.toRight((Comparable<?>) new Expr(CUTALL));
    211223    }
    212224
    213225    public void visit (AstError astError, Expr.Concatenator e) {
     226        addLineNumber(astError, e);
    214227        Expr.Concatenator error = Expr.getConcatenator();
    215228        error.toRight(ERROR);
     
    219232
    220233    public void visit (AstFail astFail, Expr.Concatenator e) {
     234        addLineNumber(astFail, e);
    221235        e.toRight((Comparable<?>) new Expr(FAIL));
    222236    }
    223237
    224238    public void visit (AstFence astFence, Expr.Concatenator e) {
     239        addLineNumber(astFence, e);
    225240        e.toRight((Comparable<?>) new Expr(FENCE));
    226241    }
    227242
    228243    public void visit (AstFormat astFormat, Expr.Concatenator e) {
     244        addLineNumber(astFormat, e);
    229245        Expr.Concatenator format = Expr.getConcatenator();
    230246        format.toRight(FORMAT);
     
    234250
    235251    public void visit (AstIter astIter, Expr.Concatenator e) {
     252        addLineNumber(astIter, e);
    236253        Expr.Concatenator iter = Expr.getConcatenator();
    237254        iter.toRight(ITER);
     
    248265
    249266    public void visit (AstNot astNot, Expr.Concatenator e) {
     267        addLineNumber(astNot, e);
    250268        Expr.Concatenator source = Expr.getConcatenator();
    251269        source.toRight(BRANCH);
     
    255273
    256274    public void visit (AstPattern astPattern, Expr.Concatenator e) {
     275        addLineNumber(astPattern, e);
    257276        Expr.Concatenator items = Expr.getConcatenator();
    258277        items.toRight(astPattern.dir.select(LEFT, RIGHT));
     
    262281
    263282    public void visit (AstResult astResult, Expr.Concatenator e) {
     283        addLineNumber(astResult, e);
    264284        Expr.Concatenator items = Expr.getConcatenator();
    265285        items.toRight(RESULT);
     
    269289
    270290    public void visit (AstSentence astSentence, Expr.Concatenator e) {
     291        addLineNumber(astSentence, e);
    271292        for (AstStatement statement : astSentence.statementList)
    272293            statement.accept(this, e);
     
    274295
    275296    public void visit (AstTrap astTrap, Expr.Concatenator e) {
     297        addLineNumber(astTrap, e);
    276298        Expr.Concatenator items = Expr.getConcatenator();
    277299        items.toRight(TRY);
Note: See TracChangeset for help on using the changeset viewer.