Changeset 184

Show
Ignore:
Timestamp:
10/08/09 11:26:04 (7 weeks ago)
Author:
lb
Message:

ParserState? with parsetree support

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/cpp_analysis/src/xtc/lang/c4/C4ParserState.java

    r183 r184  
    739739        macroValue = new Visitor() { 
    740740          public String visitObjectMacroValueSupported(GNode n) { 
    741             String dispatched = dispatch(n.getGeneric(0)).toString(); 
     741                String dispatched = dispatch(n.getGeneric(0)).toString(); 
    742742            return dispatched; 
    743743 
     
    826826          public String visitLogicalOrExpression(GNode n) { 
    827827            long tmp1 = 0, tmp2 = 0, result = 0; 
     828            int pos2 = n.size()-1; 
     829            String tmpS1, tmpS2; 
     830            
     831            tmpS1 = dispatch((Node)n.get(0)).toString(); 
     832            tmp1  = string2long(tmpS1); 
     833                
     834            tmpS2 = dispatch((Node)n.get(pos2)).toString(); 
     835            tmp2  = string2long(tmpS2); 
     836 
     837            result = ( tmp1 != 0 ) || ( tmp2 != 0 ) ?  1 : 0; 
     838 
     839            return Long.toString(result); 
     840          } 
     841 
     842          public String visitLogicalAndExpression(GNode n) { 
     843            long tmp1 = 0, tmp2 = 0, result = 0; 
     844            int pos2 = n.size()-1; 
    828845            String tmpS1, tmpS2; 
    829846            tmpS1 = dispatch((Node)n.get(0)).toString(); 
    830847            tmp1  = string2long(tmpS1); 
    831848 
    832             tmpS2 = dispatch((Node)n.get(1)).toString(); 
    833             tmp2  = string2long(tmpS2); 
    834  
    835             result = ( tmp1 != 0 ) || ( tmp2 != 0 ) ?  1 : 0; 
    836  
    837             return Long.toString(result); 
    838           } 
    839  
    840           public String visitLogicalAndExpression(GNode n) { 
    841             long tmp1 = 0, tmp2 = 0, result = 0; 
    842             String tmpS1, tmpS2; 
    843             tmpS1 = dispatch((Node)n.get(0)).toString(); 
    844             tmp1  = string2long(tmpS1); 
    845  
    846             tmpS2 = dispatch((Node)n.get(1)).toString(); 
     849            tmpS2 = dispatch((Node)n.get(pos2)).toString(); 
    847850            tmp2  = string2long(tmpS2); 
    848851