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

Last change on this file since 768 was 728, checked in by dai, 16 years ago

#200への対応。ジェネリックインターフェイスを実装したジェネリッククラスのテンプレート展開に対応。

File size: 3.8 KB
Line 
1#pragma once
2
3namespace ActiveBasic{ namespace Compiler{
4
5
6class LexicalAnalyzer
7{
8public:
9
10 // 名前空間を収集
11 static bool CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection );
12
13 // フルネーム識別子をシンボルに変換する
14 static Symbol FullNameToSymbol( const char *fullName );
15 static Symbol FullNameToSymbol( const std::string &fullName );
16
17 // 列挙型を収集
18 static void CollectEnumMembers( EnumInfo &enumInfo, const char *buffer, int nowLine );
19 static void CollectEnums( const char *source, EnumInfoCollection &enums );
20 static std::string GenerateEnumsSourceCode( const EnumInfoCollection &enums );
21
22 // クラスの名前情報を収集する
23 static void CollectClassesForNameOnly( const char *source, Classes &classes );
24
25 // TypeDefを収集する
26 static void AddTypeDef( TypeDefCollection &typeDefs, const NamespaceScopes &namespaceScopes, const std::string &expression, int nowLine );
27 static void CollectTypeDefs( const char *source, TypeDefCollection &typeDefs );
28
29 // 定数を収集する
30 static void AddConstEnum( Consts &consts, const NamespaceScopes &namespaceScopes, const char *buffer );
31 static void CollectConsts( const char *source, Consts &consts, ConstMacros &constMacros );
32 static bool ConstMacroToExpression( const ConstMacro &constMacro, const char *parameterStr, char *dest );
33
34 // クラスを収集する
35 static Member *CreateMember( const CClass &_class, Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine );
36 static void AddMethod(CClass *pobj_c, UserProc *pUserProc, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract,
37 bool isVirtual, bool isOverride, bool isEnableOverrideCheck, const char *interfaceName, bool isAutoGeneration, int nowLine);
38 static bool Inherits( CClass &_class, const char *inheritNames, int nowLine );
39 static void Implements( CClass &_class, Interface *pInterface );
40 static bool Implements( CClass &_class, const char *interfaceNames, int nowLine );
41 static void LookaheadClass( const std::string &className, Classes &classes );
42 static bool LoopRefCheck( const CClass &objClass );
43 static void CollectClasses( const char *source, Classes &classes );
44
45 // テンプレート展開
46 static Type LexicalAnalyzer::TemplateExpand_ResolveType( const Type &baseType, const Types &actualTypes );
47 static void TemplateExpand_ResolveMethod( const CMethod *pBaseMethod, const Types &actualTypes, CClass *pNewClass );
48 static const CClass *TemplateExpand( CClass &_class, const Types &actualTypes );
49
50 // グローバルプロシージャを収集する
51 static bool ExtractParameterVarNames( const char *sourceOfParams, Jenga::Common::Strings &paramVarNames, int nowLine );
52 static bool AnalyzeParameter( Parameters &params, const Jenga::Common::Strings &parameterStrings, int nowLine );
53 static bool SetParamsAndReturnTypeForUserProc( UserProc &userProc, const char *sourceOfParams, int nowLine, bool isStatic );
54 static bool SetParamsAndReturnType( Procedure *pProc, const char *sourceOfParams, bool isSupportEllipse, int nowLine );
55 static UserProc* ParseUserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, char *buffer,int nowLine,bool isVirtual,CClass *pobj_c, bool isStatic, char *interfaceName = NULL );
56 static DllProc *ParseDllProc(const NamespaceScopes &namespaceScopes, char *buffer,int nowLine);
57 static void CollectProcedures( const char *source, UserProcs &userProcs, DllProcs &dllProcs );
58
59 // デリゲートを収集する
60 static void CollectDelegates( const char *source, Delegates &delegates );
61 static std::string GenerateDelegatesSourceCode( const Delegates &delegates );
62 static void RefleshDelegateParameterAndReturnType( Delegate &dg );
63 static void RefleshDelegatesParameterAndReturnType( Delegates &delegates );
64};
65
66
67}}
Note: See TracBrowser for help on using the repository browser.