Initial
This commit is contained in:
56
http/SCAN.HPP
Normal file
56
http/SCAN.HPP
Normal file
@@ -0,0 +1,56 @@
|
||||
#ifndef _HTTP_SCAN_HPP_
|
||||
#define _HTTP_SCAN_HPP_
|
||||
#ifndef _COMMON_BLOCK_HPP_
|
||||
#include <common/block.hpp>
|
||||
#endif
|
||||
#ifndef _HTTP_EMIT_HPP_
|
||||
#include <http/emit.hpp>
|
||||
#endif
|
||||
#ifndef _HTTP_SYMBOL_HPP_
|
||||
#include <http/symbol.hpp>
|
||||
#endif
|
||||
#ifndef _HTTP_TABLE_HPP_
|
||||
#include <http/table.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_CONSOLE_HPP_
|
||||
#include <common/console.hpp>
|
||||
#endif
|
||||
|
||||
class Scan : public Emit
|
||||
{
|
||||
public:
|
||||
enum ScanSymbols{leftangle1,rightangle1,forwardslash1,ampersand1,semicolon1,exclamation1,minus1,pound1,startliteral1,literal1,name1,equal1,newline1,numeral1,endtext1,unknown1,stop1};
|
||||
Scan(PureViewOfFile &srcView,PureViewOfFile &dstView,Table &symbolTable,WORD allowUserSymbols=TRUE);
|
||||
virtual ~Scan();
|
||||
void analyze(void);
|
||||
private:
|
||||
enum {SpaceChar=32,TabChar=9};
|
||||
void readch(void);
|
||||
void skipSeparators(void);
|
||||
void scanNewLine(void);
|
||||
void scanNumeral(void);
|
||||
void scanWord(void);
|
||||
void scanLiteral(void);
|
||||
void scanLeftAngle(void);
|
||||
void scanRightAngle(void);
|
||||
void scanForwardSlash(void);
|
||||
void scanAmpersand(void);
|
||||
void scanSemicolon(void);
|
||||
void scanPound(void);
|
||||
void scanExclamation(void);
|
||||
void scanMinus(void);
|
||||
void scanEqual(void);
|
||||
void scanUnknown(void);
|
||||
|
||||
WORD mUserSymbols;
|
||||
Console mWinConsole;
|
||||
Table &mSymbolTable;
|
||||
int mChar;
|
||||
};
|
||||
|
||||
inline
|
||||
void Scan::readch(void)
|
||||
{
|
||||
mChar=read();
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user