codetools: implemented parsing c enum ID name

git-svn-id: trunk@14542 -
This commit is contained in:
mattias 2008-03-15 21:41:30 +00:00
parent af9f3ff803
commit 38f016b913
2 changed files with 13 additions and 0 deletions

View File

@ -173,6 +173,7 @@ type
function ExtractVariableType(VarNode: TCodeTreeNode;
WithDirectives: boolean = false): string;
function ExtractEnumBlockName(EnumBlockNode: TCodeTreeNode): string;
function ExtractEnumIDName(EnumIDNode: TCodeTreeNode): string;
procedure Replace(FromPos, ToPos: integer; const NewSrc: string);
@ -1199,6 +1200,13 @@ begin
end;
end;
function TCCodeParserTool.ExtractEnumIDName(EnumIDNode: TCodeTreeNode): string;
begin
MoveCursorToNode(EnumIDNode);
ReadNextAtom;
Result:=GetAtom;
end;
function TCCodeParserTool.GetAtom: string;
begin
Result:=copy(Src,AtomStart,SrcPos-AtomStart);

View File

@ -243,6 +243,11 @@ begin
CurName:=CTool.ExtractEnumBlockName(CNode);
DebugLn(['TH2PasTool.BuildH2PTree EnumBlock name="',CurName,'"']);
end;
ccnEnumID:
begin
CurName:=CTool.ExtractEnumIDName(CNode);
DebugLn(['TH2PasTool.BuildH2PTree EnumID name="',CurName,'"']);
end;
end;
CNode:=CNode.Next;
end;