You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/ast-tinyc/README.md
+5-50Lines changed: 5 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,72 +19,27 @@ So, you can use it freely without noticing the copyright of the original author.
19
19
20
20
## How to compile this example ##
21
21
22
-
### For Unix-like OS ###
23
-
24
22
You can get the executable by executing the following commands:
25
23
26
24
```
27
25
cd /path/to/this_directory
28
26
mkdir build
29
27
cd build
30
28
cmake -DPACKCC=/path/to/packcc ..
31
-
make
32
-
```
33
-
34
-
Here, `/path/to/this_directory` represents the path name of this directory,
35
-
and `/path/to/packcc` represents the path name of `packcc` command.
36
-
If `packcc` command is installed in one of the directories specified in the environment variable `PATH`,
37
-
the option `-DPACKCC=/path/to/packcc` is not necessary.
38
-
39
-
The executable `ast` will be created in the directory `build`.
40
-
41
-
### For Windows ###
42
-
43
-
#### Using Visual Studio ####
44
-
45
-
You must have [Build Tools for Visual Studio](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019) installed in your system.
46
-
You can get the executable by executing the following commands using 'Developer Command Prompt for VS 2019' or 'Developer PowerShell for VS 2019':
47
-
48
-
```
49
-
cd \path\to\this_directory
50
-
mkdir build
51
-
cd build
52
-
cmake -DPACKCC=\path\to\packcc ..
53
-
MSBuild ALL_BUILD.vcxproj
54
-
```
55
-
56
-
Here, `\path\to\this_directory` represents the path name of this directory,
57
-
and `\path\to\packcc` represents the path name of `packcc` command.
58
-
If `packcc` command is installed in one of the directories specified in the environment variable `PATH`,
59
-
the option `-DPACKCC=\path\to\packcc` is not necessary.
60
-
61
-
The executable `ast.exe` will be created in the directory `build\Debug`.
62
-
63
-
#### Using MinGW-w64 ####
64
-
65
-
You can get the executable by executing the following commands:
Here, `/path/to/this_directory` represents the path name of this directory,
76
-
and `/path/to/packcc` represents the path name of `packcc` command.
77
-
If `packcc` command is installed in one of the directories specified in the environment variable `PATH`,
78
-
the option `-DPACKCC=/path/to/packcc` is not necessary.
32
+
Here, `/path/to/this_directory` represents the path of this directory, and `/path/to/packcc` represents the path of `packcc` command.
33
+
If `packcc` command is installed in one of the directories specified in the environment variable `PATH`, the option `-DPACKCC=/path/to/packcc` is not necessary.
79
34
80
-
The executable `ast.exe` will be created in the directory `build`.
35
+
If using a build system for a Unix-like OS, MinGW, or Cygwin, which is typically `make`, the executable `ast` will be created in the current directory `build`. If using [Visual Studio](https://visualstudio.microsoft.com/) on Windows, it will be created in the directory `build\Debug`.
81
36
82
37
## How to run this example ##
83
38
84
39
Example input source files are prepared in [`inputs`](inputs) directory.
85
40
Most of these are taken from [grammars-v4](https://github.com/antlr/grammars-v4/) repository of [ANTLR project](https://github.com/antlr/) with thanks.
86
41
87
-
Here, it is assumed that you are in the directory `build`.
42
+
Here, we assume that you are in the directory `build`, and that the executable `ast` is in this directory.
88
43
If you want to print out the AST of the input source file [`inputs/example2.c`](inputs/example2.c), execute the following command:
0 commit comments