source: dev/trunk/ab5.0/abdev/BasicCompiler_Common/include/LexicalAnalyzer.h@ 609

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

DelegateクラスのLexicalAnalyzerクラスへの依存性をなくした。

File size: 3.6 KB
Line 
1#pragma once
2
3namespace ActiveBasic{ namespace Compiler{
4
5
6class 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
20public:
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 static bool ConstMacroToExpression( const ConstMacro &constMacro, const char *parameterStr, char *dest );
45
46 // クラスを収集する
47 static Member *CreateMember( const CClass &_class, Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine );
48 static void AddMethod(CClass *pobj_c, UserProc *pUserProc, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract,
49 bool isVirtual, bool isOverride, const char *interfaceName, bool isAutoGeneration, int nowLine);
50 static bool Inherits( CClass &_class, const char *inheritNames, int nowLine );
51 static void Implements( CClass &_class, Interface *pInterface, std::vector<DynamicMethod::OverrideResult> &overrideResults );
52 static bool Implements( CClass &_class, const char *interfaceNames, int nowLine );
53 static void LookaheadClass( const char *className, Classes &classes );
54 static bool LoopRefCheck( const CClass &objClass );
55 static void CollectClasses( const char *source, Classes &classes );
56
57 // グローバルプロシージャを収集する
58 static bool AnalyzeParameter( Parameters &params, const Jenga::Common::Strings &parameterStrings, int nowLine );
59 static bool SetParamsAndReturnTypeForUserProc( UserProc &userProc, const char *sourceOfParams, int nowLine, bool isStatic );
60 static bool SetParamsAndReturnType( Procedure *pProc, const char *sourceOfParams, bool isSupportEllipse, int nowLine );
61 static UserProc* ParseUserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, char *buffer,int nowLine,bool isVirtual,CClass *pobj_c, bool isStatic, char *interfaceName = NULL );
62 static DllProc *ParseDllProc(const NamespaceScopes &namespaceScopes, char *buffer,int nowLine);
63 static void CollectProcedures( const char *source, UserProcs &userProcs, DllProcs &dllProcs );
64
65 // デリゲートを収集する
66 static void CollectDelegates( const char *source, Delegates &delegates );
67 static std::string GenerateDelegatesSourceCode( const Delegates &delegates );
68 static void RefleshDelegateParameterAndReturnType( Delegate &dg );
69 static void RefleshDelegatesParameterAndReturnType( Delegates &delegates );
70};
71
72
73}}
Note: See TracBrowser for help on using the repository browser.