file: line.h
#include <String.h>
#include <strstream.h>
#include <vector>
#include <iostream.h>
#include <Regex.h>
#include <ctype.h>
class line{
private:
String raw;
vector<String> tokens;
vector<int> arguments;
bool compile;
int loc;
int lin;
// rip() takes apart a string into tokens!
void rip();
friend ostream& operator<<(ostream &o, line &a);
public:
bool num(String &token, int &value);
line(String &instr, int &number, bool compile);
line() { raw = "/n"; compile = false;}
bool equ();
bool org() const { return ((fcompare(tokens[0], "ORG") == 0) && (tokens.size() == 2));}
// instruction should return true if the string will show up in final code.
bool instruction() { return compile;}
// psuedoop returns true if the line is not compilable, is not a
// comment, and is a label, equ, or org.
bool psuedoop() { return ((equ() || org() || label()));}
// returns true if the line is some sort of comment!
// bool comment();
// returns true if the line is actually a label
bool label() const { return ((tokens.size() == 1) && (raw.lastchar() == ':'));}
// returns true if token is successfully filled with another
// unresolved token
bool next(String &token) ; //OVERLOAD CALL: next: resolved_line.cc(resolved_line), line.cpp(line), pre.cpp(preprocessor)
int arg(int &a) const { return (arguments[a]);}
int location() const { return loc;}
int number() const { return lin;}
int byte();
String basestring() const { return raw;}
String resolvedstring();
// fill replaces 'String replace' with 'String with' in the vector.
// If 'String with' is numerical, the appropriate numerical value is
// placed in arguments.
void fillarg(String &replace, String &with);
void location(int a) { loc = a;}
};
C++ to HTML Conversion by ctoohtml