Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <iostream>
- #include<stdlib.h>
- using namespace std;
- void parse_line(string& parse){
- string word;
- int count = 0;
- for(int i = 0 ; i < parse.length(); i++){
- if(parse[i] == '.'){
- cout<<"pushing "<<word<<endl;
- count++;
- word.clear();
- break;
- }
- else if(parse[i] == ' '){
- if(!word.empty()){
- cout<<"pushing "<<word<<endl;
- count++;
- }
- word.clear();
- }
- else{
- word +=parse[i];
- }
- }
- if(count > 2){
- cout<<"push first element as label";
- }
- else{
- cout<<"ignore";
- }
- }
- int main(){
- //string parse = " START 1000 .blah blah blah blah blah blha blha";
- string parse = "COPY START 1000 .blah blah blah blah blah blha blha";
- parse_line(parse);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement