1 | #pragma once
|
---|
2 |
|
---|
3 | namespace ActiveBasic{ namespace Compiler{
|
---|
4 |
|
---|
5 |
|
---|
6 | class LexicalAnalyzer
|
---|
7 | {
|
---|
8 | class SourceTemplate
|
---|
9 | {
|
---|
10 | std::string source;
|
---|
11 | public:
|
---|
12 | SourceTemplate( const std::string &filePath );
|
---|
13 | ~SourceTemplate()
|
---|
14 | {
|
---|
15 | }
|
---|
16 |
|
---|
17 | std::string GetResult( const std::map<std::string,std::string> &values );
|
---|
18 | };
|
---|
19 |
|
---|
20 | public:
|
---|
21 |
|
---|
22 | // 名前空間を収集
|
---|
23 | static bool CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection );
|
---|
24 |
|
---|
25 | // フルネーム識別子をシンボルに変換する
|
---|
26 | static Symbol FullNameToSymbol( const char *fullName );
|
---|
27 | static Symbol FullNameToSymbol( const std::string &fullName );
|
---|
28 |
|
---|
29 | // 列挙型を収集
|
---|
30 | static void CollectEnumMembers( EnumInfo &enumInfo, const char *buffer, int nowLine );
|
---|
31 | static void CollectEnums( const char *source, EnumInfoCollection &enums );
|
---|
32 | static std::string GenerateEnumsSourceCode( const EnumInfoCollection &enums );
|
---|
33 |
|
---|
34 | // クラスの名前情報を収集する
|
---|
35 | static void CollectClassesForNameOnly( const char *source, Classes &classes );
|
---|
36 |
|
---|
37 | // TypeDefを収集する
|
---|
38 | static void AddTypeDef( TypeDefCollection &typeDefs, const NamespaceScopes &namespaceScopes, const std::string &expression, int nowLine );
|
---|
39 | static void CollectTypeDefs( const char *source, TypeDefCollection &typeDefs );
|
---|
40 |
|
---|
41 | // 定数を収集する
|
---|
42 | static void AddConstEnum( Consts &consts, const NamespaceScopes &namespaceScopes, const char *buffer );
|
---|
43 | static void CollectConsts( const char *source, Consts &consts, ConstMacros &constMacros );
|
---|
44 |
|
---|
45 | // クラスを収集する
|
---|
46 | static Member *CreateMember( const CClass &_class, Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine );
|
---|
47 | static void AddMethod(CClass *pobj_c, UserProc *pUserProc, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract,
|
---|
48 | bool isVirtual, bool isOverride, const char *interfaceName, bool isAutoGeneration, int nowLine);
|
---|
49 | static bool Inherits( CClass &_class, const char *inheritNames, int nowLine );
|
---|
50 | static void Implements( CClass &_class, Interface *pInterface, std::vector<DynamicMethod::OverrideResult> &overrideResults );
|
---|
51 | static bool Implements( CClass &_class, const char *interfaceNames, int nowLine );
|
---|
52 | static void LookaheadClass( const char *className, Classes &classes );
|
---|
53 | static bool LoopRefCheck( const CClass &objClass );
|
---|
54 | static void CollectClasses( const char *source, Classes &classes );
|
---|
55 |
|
---|
56 | // グローバルプロシージャを収集する
|
---|
57 | static UserProc* ParseUserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, char *buffer,int nowLine,bool isVirtual,CClass *pobj_c, bool isStatic, char *interfaceName = NULL );
|
---|
58 | static void CollectProcedures( const char *source, UserProcs &userProcs, DllProcs &dllProcs );
|
---|
59 |
|
---|
60 | // デリゲートを収集する
|
---|
61 | static void CollectDelegates( const char *source, Delegates &delegates );
|
---|
62 | static std::string GenerateDelegatesSourceCode( const Delegates &delegates );
|
---|
63 | static void RefleshDelegatesParameterAndReturnType( Delegates &delegates );
|
---|
64 | };
|
---|
65 |
|
---|
66 |
|
---|
67 | }}
|
---|