Changeset 2298 in Sophya for trunk/SophyaPI
- Timestamp:
- Dec 11, 2002, 6:43:11 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/piacmd.cc
r2297 r2298 862 862 // >>>> Separating keyword and tokens 863 863 vector<string> tokens; 864 /*865 q = s2.find(' ');866 l = s2.length();867 if (q < l)868 { kw = s2.substr(0,q); toks = s2.substr(q, l-q); }869 else { kw = s2; toks = ""; }870 871 q = 0;872 while (q < l) {873 p = toks.find_first_not_of(" \t",q+1); // au debut d'un token874 if (p>=l) break;875 if ( (toks[p] == '\'') || (toks[p] == '"') ) {876 q = toks.find(toks[p],p+1);877 if (q>=l) {878 cerr << "PIACmd::Interpret()/Syntax Error - Unbalenced quotes " << toks[p] << '.' << endl;879 return(2);880 }881 p++;882 }883 else {884 q = toks.find_first_of(" \t",p); // la fin du token;885 }886 string token = toks.substr(p,q-p);887 tokens.push_back(token);888 }889 */890 864 /* decoupage en mots */ 891 865 LineToWords(s2, kw, tokens, toks, true); 866 892 867 // Si c'est un for/foreach, on cree un nouveau bloc 893 868 if ((kw == "foreach") || (kw == "for")) { … … 948 923 bool ohv = histon; 949 924 histon = false; 925 tokens.insert(tokens.begin(), kw); 950 926 PushStack(tokens); 951 927 (*sit).second->Execute(tokens);
Note:
See TracChangeset
for help on using the changeset viewer.