Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef CODE_H
- #define CODE_H
- #include <iostream>
- #include <vector>
- using namespace std;
- class code : public string
- {
- public:
- //constructeur par défault
- code(string filename);
- //crée des fragments de chaine
- vector<code> split(char spliter);
- ///toutes les fonctions suivantes ne prennent pas en compte les espaces
- //retourne le prochain caractère
- char nextChar();
- //retourne le prochain mot
- code nextWord();
- //retourne le prochain nombre entier rencontre
- int nextInt();
- //retourne le prochain nombre floatant rencontre
- float nextFloat();
- //retourne le prochain operateur
- char nextOperator();
- //retourne la prochaine chaine de caractère du genre "hello"
- code nextString();
- //return true si c est un operateur +-/*%
- static bool isOperator(char c);
- //return true si c'est une constante : "hello" 27 75.14
- static bool isConstant(string mot);
- //return true si c'est un array
- static bool isArray(string mot);
- protected:
- //position du curseur virtuelle dans la chaine
- int curPos;
- private:
- };
- #endif // CODE_H
Advertisement
Add Comment
Please, Sign In to add comment