Skip to content

Commit

Permalink
Update paths and names in README
Browse files Browse the repository at this point in the history
  • Loading branch information
mtreinish committed Jan 11, 2024
1 parent ad75fca commit 40e96f2
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,22 @@ For instance, I hope to soon replace "I" with "we".

The first three crates are based on tools for `rust` and `rust-analyzer`.

* [lexer](./crates/lexer) -- A lightly modified version of the `rustc` (the rust compiler) lexer.
* [parser](./crates/parser) -- Ingests output of `lexer` and outputs a concrete syntax tree.
* [oq3_lexer](./crates/oq3_lexer) -- A lightly modified version of the `rustc` (the rust compiler) lexer.
* [oq3_parser](./crates/oq3_parser) -- Ingests output of `lexer` and outputs a concrete syntax tree.
* [oq3_syntax](./crates/oq3_syntax) -- Ingests output of `parser` and outputs an abstract syntax tree (AST).
The rust-analyzer [documentation](#design) sometimes refers to this AST by something like "typed AST".
This can be confusing. It does not mean that semantic
analysis has been performed and OQ3 types have been assigned to all expressions. It means that the rust type system is
used to encode syntactic elements, in contrast to some lower representations in the same crate.
* [semantics](./crates/semantics) -- Performs [semantic analysis](https://en.wikipedia.org/wiki/Compiler#Front_end)
* [semantics](./crates/oq3_semantics) -- Performs [semantic analysis](https://en.wikipedia.org/wiki/Compiler#Front_end)
and outputs an [abstract semantic graph (ASG)](https://en.wikipedia.org/wiki/Abstract_semantic_graph)
There are other names for this structure. But "ASG" is convenient.
* [source_file](./crates/source_file) -- A higher-level interface to the syntactic AST. This sits beetween the syntactic AST and
* [source_file](./crates/oq3_source_file) -- A higher-level interface to the syntactic AST. This sits beetween the syntactic AST and
semantic ASG. This crate manages the main source file and incuded source files.
* [ast_pyo3](./crates/source_file) Experimental code. It will not be used in it's current form.

#### Supporting crates

* [sourcegen](./crates/sourcegen) -- supports code generation. This is a very small crate that is copied here because the external
* [sourcegen](./crates/oq3_sourcegen) -- supports code generation. This is a very small crate that is copied here because the external
crate has a bug.

### Warning !
Expand All @@ -55,14 +54,14 @@ the test system (you read correctly). If possible, we plan to change this to a m
### Using this front end

A reminder: A front end is not of much use unless you have a back end. Examples showing the entry points and how to use them,
can be found in [./crates/semantics/examples/semdemo.rs](./crates/semantics/examples/semdemo.rs).
can be found in [./crates/oq3_semantics/examples/semdemo.rs](./crates/oq3_semantics/examples/semdemo.rs).

```shell
shell> export QASM3_PATH=./crates/semantics/examples/qasm/
shell> cargo run --example semdemo -- semantic scratch1.qasm
```

Replace `scratch1.qasm` with some file found in [./crates/semantics/examples/qasm/](./crates/semantics/examples/qasm/).
Replace `scratch1.qasm` with some file found in [./crates/oq3_semantics/examples/qasm/](./crates/oq3_semantics/examples/qasm/).

#### Search path

Expand Down

0 comments on commit 40e96f2

Please sign in to comment.