Skip to content

Commit 3b5801f

Browse files
committed
improved the whole doc
1 parent 4d95283 commit 3b5801f

2 files changed

Lines changed: 38 additions & 38 deletions

File tree

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ CppParser
55
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e2a1f6c5c8c149be816f1514ec491c98)](https://www.codacy.com/app/satya-das/cppparser?utm_source=github.com&utm_medium=referral&utm_content=satya-das/cppparser&utm_campaign=Badge_Grade)
66
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
77

8-
An easy, fast, and robust library to parse C/C++ source.
8+
An easy, fast, and robust library to parse C/C++ source code.
99

1010
## Features
11-
- No pre-processing, and preprocessors are part of the ast.
12-
- Most comments are preserved too.
13-
- Developed from scratch and uses back-tracking yacc (BtYacc) to write C++ grammer, that means **no dependency on libclang**.
14-
- The result of parsing is an AST where elements of a file are arranged in a tree.
15-
- Minimum dependency. Only external dependency is a [lexer](https://github.com/westes/flex) which is by default available on unix like platforms (Linux, Mac, etc.) and [Flex for Windows](http://gnuwin32.sourceforge.net/packages/flex.htm) is bundled with the project so it works out of the box on all Windows platforms too.
16-
- Parsing of multi-file program is supported too.
17-
18-
## Motivation
11+
- No preprocessing; preprocessor constructs are part of the AST.
12+
- Preserves most comments.
13+
- Implemented from scratch using backtracking Yacc (BtYacc), so **no dependency on libclang**.
14+
- Parses into a structured AST where file elements form a tree.
15+
- Minimal dependencies: [Flex](https://github.com/westes/flex) on Unix-like platforms (Linux, macOS, etc.). On Windows, [Flex for Windows](http://gnuwin32.sourceforge.net/packages/flex.htm) is bundled for out-of-the-box usage.
16+
- Supports parsing multi-file programs.
17+
18+
## Motivation
1919
CppParser can be used to build tools that need parsing of C/C++ files.
20-
I am using it to develop [cib](https://github.com/satya-das/cib/) which implements ABI stable SDK architecture for C++ library.
20+
It is also used to develop [cib](https://github.com/satya-das/cib/), which implements ABI-stable SDK architecture for C++ libraries.
2121

2222
## Example
2323

24-
To begin with we will see an example of parsing a hello-world program and see what is the AST that `CppParser` creates:
24+
To begin with we will see an example of parsing a hello-world program and see the AST that `CppParser` creates:
2525
```c++
2626
#include <iostream>
2727

@@ -34,11 +34,11 @@ int main()
3434

3535
```
3636

37-
For the above hello-world program we can expect that when it is parsed the generated AST should look like following:
37+
For the above hello-world program we can expect the generated AST to look like the following:
3838
![AST for Hello World program](https://github.com/satya-das/cppparser/blob/master/cppparser/src/readme-assets/HelloWorldAST.svg "AST for Hello World program")
3939

40-
So, how we are going to access these elements of AST using `CppParser`?
41-
Below is the program written as unit-test for validating the correctness of generated AST:
40+
So, how do we access these elements of AST using `CppParser`?
41+
Below is the program written as a unit test for validating the correctness of the generated AST:
4242

4343
```c++
4444
#include <catch/catch.hpp>
@@ -86,9 +86,9 @@ TEST_CASE("Parsing hello world program")
8686

8787
```
8888
89-
**This example is a real one and is part of actual unit test of CppParser**.
89+
**This example is real and is part of the actual unit tests for CppParser**.
9090
91-
For AST traversing, see the [CppWriter](cppwriter), that uses the generated AST to create files.
91+
For AST traversal, see [CppWriter](cppwriter), which uses the generated AST to create files.
9292
9393
## Building CppParser
9494
@@ -120,15 +120,15 @@ ninja
120120

121121
## For contributors who need to run tests
122122

123-
Make sure you also clone the dependencies. Run the following command in the parent directory of root of the `cppparser`.
123+
Make sure you also clone the dependencies. Run the following command in the parent directory of the root of `cppparser`.
124124

125125
```sh
126126
git clone https://github.com/satya-das/common.git
127127
```
128128

129-
After this command the `common` and `cppparser` should be in the same folder.
129+
After this command the `common` and `cppparser` folders should be side by side.
130130

131-
## Configure and run test
131+
## Configure and run tests
132132

133133
```sh
134134
cd cppparser

cppparser/src/README.mdpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,36 @@ CppParser
55
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e2a1f6c5c8c149be816f1514ec491c98)](https://www.codacy.com/app/satya-das/cppparser?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=satya-das/cppparser&amp;utm_campaign=Badge_Grade)
66
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
77

8-
An easy, fast, and robust library to parse C/C++ source.
8+
An easy, fast, and robust library to parse C/C++ source code.
99

1010
## Features
11-
- No pre-processing, and preprocessors are part of the ast.
12-
- Most comments are preserved too.
13-
- Developed from scratch and uses back-tracking yacc (BtYacc) to write C++ grammer, that means **no dependency on libclang**.
14-
- The result of parsing is an AST where elements of a file are arranged in a tree.
15-
- Minimum dependency. Only external dependency is a [lexer](https://github.com/westes/flex) which is by default available on unix like platforms (Linux, Mac, etc.) and [Flex for Windows](http://gnuwin32.sourceforge.net/packages/flex.htm) is bundled with the project so it works out of the box on all Windows platforms too.
16-
- Parsing of multi-file program is supported too.
17-
18-
## Motivation
11+
- No preprocessing; preprocessor constructs are part of the AST.
12+
- Preserves most comments.
13+
- Implemented from scratch using backtracking Yacc (BtYacc), so **no dependency on libclang**.
14+
- Parses into a structured AST where file elements form a tree.
15+
- Minimal dependencies: [Flex](https://github.com/westes/flex) on Unix-like platforms (Linux, macOS, etc.). On Windows, [Flex for Windows](http://gnuwin32.sourceforge.net/packages/flex.htm) is bundled for out-of-the-box usage.
16+
- Supports parsing multi-file programs.
17+
18+
## Motivation
1919
CppParser can be used to build tools that need parsing of C/C++ files.
20-
I am using it to develop [cib](https://github.com/satya-das/cib/) which implements ABI stable SDK architecture for C++ library.
20+
It is also used to develop [cib](https://github.com/satya-das/cib/), which implements ABI-stable SDK architecture for C++ libraries.
2121

2222
## Example
2323

24-
To begin with we will see an example of parsing a hello-world program and see what is the AST that `CppParser` creates:
24+
To begin with we will see an example of parsing a hello-world program and see the AST that `CppParser` creates:
2525
!INCLUDECODE "cppparser/test/unit/test-files/hello-world.cpp" (c++)
2626

27-
For the above hello-world program we can expect that when it is parsed the generated AST should look like following:
27+
For the above hello-world program we can expect the generated AST to look like the following:
2828
![AST for Hello World program](https://github.com/satya-das/cppparser/blob/master/cppparser/src/readme-assets/HelloWorldAST.svg "AST for Hello World program")
2929

30-
So, how we are going to access these elements of AST using `CppParser`?
31-
Below is the program written as unit-test for validating the correctness of generated AST:
30+
So, how do we access these elements of AST using `CppParser`?
31+
Below is the program written as a unit test for validating the correctness of the generated AST:
3232

3333
!INCLUDECODE "cppparser/test/unit/test-hello-world.cpp" (c++)
3434

35-
**This example is a real one and is part of actual unit test of CppParser**.
35+
**This example is real and is part of the actual unit tests for CppParser**.
3636

37-
For AST traversing, see the [CppWriter](cppwriter), that uses the generated AST to create files.
37+
For AST traversal, see [CppWriter](cppwriter), which uses the generated AST to create files.
3838

3939
## Building CppParser
4040

@@ -66,15 +66,15 @@ ninja
6666

6767
## For contributors who need to run tests
6868

69-
Make sure you also clone the dependencies. Run the following command in the parent directory of root of the `cppparser`.
69+
Make sure you also clone the dependencies. Run the following command in the parent directory of the root of `cppparser`.
7070

7171
```sh
7272
git clone https://github.com/satya-das/common.git
7373
```
7474

75-
After this command the `common` and `cppparser` should be in the same folder.
75+
After this command the `common` and `cppparser` folders should be side by side.
7676

77-
## Configure and run test
77+
## Configure and run tests
7878

7979
```sh
8080
cd cppparser

0 commit comments

Comments
 (0)