Skip to content

Commit 9c1cb88

Browse files
committed
move content of readme file
1 parent 4b506c2 commit 9c1cb88

File tree

2 files changed

+42
-34
lines changed

2 files changed

+42
-34
lines changed

parser/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,48 @@ For more information on LALRPOP, here is a link to the [LALRPOP book](https://gi
1414

1515
There is a readme in the `src` folder with the details of each file.
1616

17+
18+
## Directory content
19+
20+
`build.rs`: The build script.
21+
`Cargo.toml`: The config file.
22+
23+
The `src` directory has:
24+
25+
**lib.rs**
26+
This is the crate's root.
27+
28+
**lexer.rs**
29+
This module takes care of lexing python source text. This means source code is translated into separate tokens.
30+
31+
**parser.rs**
32+
A python parsing module. Use this module to parse python code into an AST. There are three ways to parse python code. You could parse a whole program, a single statement, or a single expression.
33+
34+
**ast.rs**
35+
Implements abstract syntax tree (AST) nodes for the python language. Roughly equivalent to [the python AST](https://docs.python.org/3/library/ast.html).
36+
37+
**python.lalrpop**
38+
Python grammar.
39+
40+
**token.rs**
41+
Different token definitions. Loosely based on token.h from CPython source.
42+
43+
**errors.rs**
44+
Define internal parse error types. The goal is to provide a matching and a safe error API, masking errors from LALR.
45+
46+
**fstring.rs**
47+
Format strings.
48+
49+
**function.rs**
50+
Collection of functions for parsing parameters, arguments.
51+
52+
**location.rs**
53+
Datatypes to support source location information.
54+
55+
**mode.rs**
56+
Execution mode check. Allowed modes are `exec`, `eval` or `single`.
57+
58+
1759
## How to use
1860

1961
For example, one could do this:

parser/src/README.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)