Changeset 4127


Ignore:
Timestamp:
Dec 18, 2009, 4:21:57 PM (11 years ago)
Author:
yura
Message:
  • Using COL_CURL.
Location:
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/parser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/parser/Rf5Parser.java

    r4125 r4127  
    1616import static org.refal.rfpdt.parser.TkTags.CHAR;
    1717import static org.refal.rfpdt.parser.TkTags.COL;
     18import static org.refal.rfpdt.parser.TkTags.COL_CURL;
    1819import static org.refal.rfpdt.parser.TkTags.COMMA;
    1920import static org.refal.rfpdt.parser.TkTags.ENTRY;
     
    217218    // block
    218219
     220    // conditions
     221    // : (COMMA)
     222    // COMMA #exp conditions2
     223    // | (EQL)
     224    // EQL #exp
     225
     226    // conditions2
     227    // : (COL)
     228    // COL #exp conditions
     229    // | (COL_CURL)
     230    // COL_CURL block
     231    // ;
     232
    219233    private void conditions (long ftk, ArrayList<AstStatement> statements) {
    220234        while (sync(s_rf5_conditions, ftk)) {
    221235            if (tkIs(COMMA)) {
    222236                nextTk();
    223                 AstExpr astExpr = expr(COL | ftk);
     237                AstExpr astExpr = expr(s_rf5_conditions2 | ftk);
    224238                statements.add(new AstResult(astExpr.pos, astExpr));
    225                 accept(COL, s_rf5_conditions2 | ftk);
    226                 if (tkIs(LCURL)) {
     239                if (tkIs(COL)) {
     240                    nextTk();
     241                    astExpr = expr(s_rf5_conditions | ftk);
     242                    statements.add(new AstPattern(astExpr.pos, MatchDir.L, astExpr));
     243                    continue;
     244                } else if (tkIs(COL_CURL)) {
     245                    nextTk();
    227246                    statements.add(block(ftk));
    228                     break;
    229                 } else {
    230                     astExpr = expr(s_rf5_conditions);
    231                     statements.add(new AstPattern(astExpr.pos, MatchDir.L, astExpr));
    232247                }
    233248            } else {
     
    238253                statements.add(new AstResult(astExpr.pos, astExpr));
    239254            }
     255            break;
    240256        }
    241257    }
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/parser/TkFollowers.java

    r4122 r4127  
    6666    public static final long f_rf5_sentences = RCURL;
    6767    public static final long f_rf5_sentences2 = RCURL;
    68     public static final long f_rf5_expr = COL | COMMA | EQL | RANGU | RCURL | RPAR | SC;
     68    public static final long f_rf5_expr = COL | COL_CURL | COMMA | EQL | RANGU | RCURL | RPAR | SC;
    6969}
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/parser/TkStarters.java

    r4122 r4127  
    9292    public static final long s_rf5_sentence = CHAR | COMMA | EQL | LANGU | LPAR | NUMB | VAR | WORD;
    9393    public static final long s_rf5_conditions = COMMA | EQL;
    94     public static final long s_rf5_conditions2 = CHAR | COMMA | EQL | LANGU | LCURL | LPAR | NUMB | VAR | WORD;
     94    public static final long s_rf5_conditions2 = COL | COL_CURL;
    9595    public static final long s_rf5_expr = CHAR | LANGU | LPAR | NUMB | VAR | WORD;
    9696    public static final long s_rf5_expr_head = CHAR | LANGU | LPAR | NUMB | VAR | WORD;
Note: See TracChangeset for help on using the changeset viewer.