source: dev/branches/egtra/ab5.0/abdev/BasicCompiler_Common/include/LexicalAnalyzer.h

Last change on this file was 814, checked in by イグトランス (egtra), 14 years ago

LexicalAnalyzer周りの修正

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