From 9c1cb881d110ef163579c17883b9804793c7008a Mon Sep 17 00:00:00 2001 From: Mireille Raad Date: Fri, 3 Apr 2020 10:18:04 -0400 Subject: [PATCH] move content of readme file --- parser/README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ parser/src/README.md | 34 ---------------------------------- 2 files changed, 42 insertions(+), 34 deletions(-) delete mode 100644 parser/src/README.md diff --git a/parser/README.md b/parser/README.md index 0dc17f548..ef65fa303 100644 --- a/parser/README.md +++ b/parser/README.md @@ -14,6 +14,48 @@ For more information on LALRPOP, here is a link to the [LALRPOP book](https://gi There is a readme in the `src` folder with the details of each file. + +## Directory content + +`build.rs`: The build script. +`Cargo.toml`: The config file. + +The `src` directory has: + +**lib.rs** +This is the crate's root. + +**lexer.rs** +This module takes care of lexing python source text. This means source code is translated into separate tokens. + +**parser.rs** +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. + +**ast.rs** + Implements abstract syntax tree (AST) nodes for the python language. Roughly equivalent to [the python AST](https://docs.python.org/3/library/ast.html). + +**python.lalrpop** +Python grammar. + +**token.rs** +Different token definitions. Loosely based on token.h from CPython source. + +**errors.rs** +Define internal parse error types. The goal is to provide a matching and a safe error API, masking errors from LALR. + +**fstring.rs** +Format strings. + +**function.rs** +Collection of functions for parsing parameters, arguments. + +**location.rs** +Datatypes to support source location information. + +**mode.rs** +Execution mode check. Allowed modes are `exec`, `eval` or `single`. + + ## How to use For example, one could do this: diff --git a/parser/src/README.md b/parser/src/README.md deleted file mode 100644 index 32034f83a..000000000 --- a/parser/src/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# RustPython/parser/src - -**lib.rs** -This is the crate's root. - -**lexer.rs** -This module takes care of lexing python source text. This means source code is translated into separate tokens. - -**parser.rs** -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. - -**ast.rs** - Implements abstract syntax tree (AST) nodes for the python language. Roughly equivalent to [the python AST](https://docs.python.org/3/library/ast.html). - -**python.lalrpop** -Python grammar. - -**token.rs** -Different token definitions. Loosely based on token.h from CPython source. - -**errors.rs** -Define internal parse error types. The goal is to provide a matching and a safe error API, masking errors from LALR. - -**fstring.rs** -Format strings. - -**function.rs** -Collection of functions for parsing parameters, arguments. - -**location.rs** -Datatypes to support source location information. - -**mode.rs** -Execution mode check. Allowed modes are `exec`, `eval` or `single`.