source: dev/BasicCompiler_Common/include/Source.h@ 87

Last change on this file since 87 was 87, checked in by dai_9181, 17 years ago

House::Metaを追加。
Source.h/Source.cppを追加(実装はこれから)。

File size: 845 bytes
Line 
1#pragma once
2
3#include <vector>
4#include <string>
5
6#include <windows.h>
7#include <stdlib.h>
8
9using namespace std;
10
11class Text{
12protected:
13 char *buffer;
14 int length;
15
16public:
17
18 enum ReturnLineChar{
19 CR,
20 LF,
21 CRLF,
22 };
23
24 Text(){
25 buffer = (char *)calloc( 1, 1 );
26 length = 0;
27 }
28 ~Text(){
29 free( buffer );
30 }
31
32 bool ReadFile( const string &filePath );
33
34 void ChangeReturnLineChar();
35
36 char *Buffer(){
37 return buffer;
38 }
39 int Length(){
40 return length;
41 }
42};
43
44class BasicSource : public Text
45{
46public:
47 BasicSource(){}
48 ~BasicSource(){}
49
50 void RemoveComments();
51
52 void DirectiveIfdef();
53 void DirectiveIncludeOrRequire();
54
55 void RemoveReturnLineUnderbar();
56
57 void FormatDefStatement();
58 void FormatIfStatement();
59
60 bool Generate( const string &genName, const char *buffer );
61};
Note: See TracBrowser for help on using the repository browser.