Ignore:
Timestamp:
08/28/07 13:03:04 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mdata/MDataPhrase.cc

    r8717 r8719  
    321321        idx++;
    322322    }
    323 
     323    /*
     324
     325    // * HOW DO WE PROCESS THE FILTERS?
     326    // * DO WE NEED THIS FOR MData derived classes? Is there any need for it?
     327    // * MAYBE FIRST FILTERS (MF?) MUST REPLACE {name[class]} BEFORE
     328    //   THE DATA PHRASSE IS CREATED?
     329    // --> MFDataPhrase must have a list of MFilter. In Process first
     330    //     all self created MFilter are processed (see MF). Then
     331    //     they are evaluated and the result is given to the MDataPhrase.
     332    //     Can this be done using MDataMember? We replace {Name[class]}
     333    //     by Name.IsExpressionTrue and we need a way that MDataPhrase
     334    //     gets the coresponding pointer.
     335    // --> Alternatively we can create a MDataPhrase which allows
     336    //     Pre/Processing
     337    //
     338    // We convert {Name[Class]} to Name.IsExpressionTrue. To process these
     339    // data/filters we need a request from MFDataPhrase (new virtual
     340    // memeber function?)
     341    //
     342    // {} Is alreaqdy used in ReadEnv.
     343    //
     344    // Enhance ReadEnv to allow Cut1.5 to be just a class.
     345    //
     346    // The difference between MFDataPhrase is
     347    //   MFDataPhrase only knows MDataPhrase, while
     348    //   MF also knows a filter-class.
     349    //
     350
     351    p = 0;
     352
     353    // And now we check for other phrases or filters
     354    // They are defined by a [, a pribtable character and
     355    // any numer of word characters (a-zA-Z0-9_) and a closing ]
     356    reg = TPRegexp("{[A-Za-z}\\w+(\\[[A-Za-z]\\w+\\])?}");
     357    while (1)
     358    {
     359        // If some indices are already existing
     360        // initialize them by a MDataValue
     361        idx = CheckForVariable(phrase, idx);
     362
     363        // Check whether expression is found
     364        if (reg.Match(phrase, mods, p, 130, &pos)==0)
     365            break;
     366
     367        // Get expression from phrase
     368        TString expr = phrase(pos[0], pos[1]-pos[0]);
     369
     370        // Zerlegen: {Name[Class]}
     371
     372        // Create a new MData object of kind
     373        MData *dat = (MData*)GetNewObject(cls, MData::Class());
     374        if (!dat)
     375            return "";
     376        dat->SetName(name);
     377
     378        // Add a corresponding MDataMember to our list
     379        fMembers.AddLast(dat);
     380
     381        // Make the expression "Regular expression proofed"
     382        expr.ReplaceAll("[", "\\[");
     383        expr.ReplaceAll("]", "\\]");
     384
     385        // Find other occurances of arg by this regexp
     386        // and start next search behind first match
     387        p = pos[0] + Substitute(phrase, expr, idx);
     388
     389        // Step forward to the next argument
     390        idx++;
     391    }
     392 */
    324393    // Now we have to check if there are additional indices [idx]
    325394    // This is mainly important if the rule has indices only!
Note: See TracChangeset for help on using the changeset viewer.