|
1 | 1 | ### Abstract Syntax Tree Builder for Delphi |
2 | 2 | With DelphiAST you can take real Delphi code and get an abstract syntax tree. One unit at time and without a symbol table though. |
3 | 3 |
|
4 | | -FreePascal and Lazarus compatible. |
| 4 | +This is forked from https://github.com/RomanYankovsky/DelphiAST |
5 | 5 |
|
6 | | -#### Sample input |
7 | | -```delphi |
8 | | -unit Unit1; |
9 | | -
|
10 | | -interface |
11 | | -
|
12 | | -uses |
13 | | - Unit2; |
14 | | -
|
15 | | -function Sum(A, B: Integer): Integer; |
16 | | -
|
17 | | -implementation |
18 | | -
|
19 | | -function Sum(A, B: Integer): Integer; |
20 | | -begin |
21 | | - Result := A + B; |
22 | | -end; |
23 | | -
|
24 | | -end. |
25 | | -``` |
26 | | - |
27 | | -#### Sample outcome |
28 | | -```xml |
29 | | -<UNIT line="1" col="1" name="Unit1"> |
30 | | - <INTERFACE line="3" col="1"> |
31 | | - <USES line="5" col="1"> |
32 | | - <UNIT line="6" col="3" name="Unit2"/> |
33 | | - </USES> |
34 | | - <METHOD line="8" col="1" kind="function" name="Sum"> |
35 | | - <PARAMETERS line="8" col="13"> |
36 | | - <PARAMETER line="8" col="14"> |
37 | | - <NAME line="8" col="14" value="A"/> |
38 | | - <TYPE line="8" col="20" name="Integer"/> |
39 | | - </PARAMETER> |
40 | | - <PARAMETER line="8" col="17"> |
41 | | - <NAME line="8" col="17" value="B"/> |
42 | | - <TYPE line="8" col="20" name="Integer"/> |
43 | | - </PARAMETER> |
44 | | - </PARAMETERS> |
45 | | - <RETURNTYPE line="8" col="30"> |
46 | | - <TYPE line="8" col="30" name="Integer"/> |
47 | | - </RETURNTYPE> |
48 | | - </METHOD> |
49 | | - </INTERFACE> |
50 | | - <IMPLEMENTATION line="10" col="1"> |
51 | | - <METHOD line="12" col="1" kind="function" name="Sum"> |
52 | | - <PARAMETERS line="12" col="13"> |
53 | | - <PARAMETER line="12" col="14"> |
54 | | - <NAME line="12" col="14" value="A"/> |
55 | | - <TYPE line="12" col="20" name="Integer"/> |
56 | | - </PARAMETER> |
57 | | - <PARAMETER line="12" col="17"> |
58 | | - <NAME line="12" col="17" value="B"/> |
59 | | - <TYPE line="12" col="20" name="Integer"/> |
60 | | - </PARAMETER> |
61 | | - </PARAMETERS> |
62 | | - <RETURNTYPE line="12" col="30"> |
63 | | - <TYPE line="12" col="30" name="Integer"/> |
64 | | - </RETURNTYPE> |
65 | | - <STATEMENTS begin_line="13" begin_col="1" end_line="15" end_col="4"> |
66 | | - <ASSIGN line="14" col="3"> |
67 | | - <LHS line="14" col="3"> |
68 | | - <IDENTIFIER line="14" col="3" name="Result"/> |
69 | | - </LHS> |
70 | | - <RHS line="14" col="13"> |
71 | | - <EXPRESSION line="14" col="13"> |
72 | | - <ADD line="14" col="15"> |
73 | | - <IDENTIFIER line="14" col="13" name="A"/> |
74 | | - <IDENTIFIER line="14" col="17" name="B"/> |
75 | | - </ADD> |
76 | | - </EXPRESSION> |
77 | | - </RHS> |
78 | | - </ASSIGN> |
79 | | - </STATEMENTS> |
80 | | - </METHOD> |
81 | | - </IMPLEMENTATION> |
82 | | -</UNIT> |
83 | | -``` |
| 6 | +Please use that branch, not this one. |
84 | 7 |
|
85 | 8 | #### Copyright |
86 | 9 | Copyright (c) 2014-2015 Roman Yankovsky (roman@yankovsky.me) |
|
0 commit comments