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
2.`cd` into the `crawfish/` directory, then build the project with GNU Make
38
+
4.`cd` into the `crawfish/` directory, then build the project with GNU Make
26
39
27
40
```sh
28
41
cd crawfish/
29
-
make
42
+
cargo build --release
30
43
```
31
44
32
-
4. Move the `build/crawfish` compiler binary to a desired location (e.g. in `/Users/<your name>`), then add it to your `PATH` by adding the following line to your `.bashrc` file
45
+
5. Move the `target/release/crawfish` binary to a desired location (e.g. in `/Users/<your name>`), then add it to your `PATH` by adding the following line to your `.bashrc` file
33
46
34
47
```sh
35
48
# in your .bashrc
@@ -38,4 +51,18 @@ export PATH=$PATH:<path to the crawfish compiler executable>
38
51
39
52
## Usage
40
53
54
+
```
55
+
Crawfish compiler
56
+
57
+
Usage:
58
+
crawfish [OPTIONS] <COMMAND> [ARGS...]
59
+
60
+
Command:
61
+
compile <file>.crw compile the current file
62
+
63
+
Options:
64
+
-h, --help print possible commands
65
+
-v, --version print compiler version
66
+
```
67
+
41
68
See `docs/tour-of-crawfish.md` for a tour of the language.
Copy file name to clipboardExpand all lines: docs/ARCHITECTURE.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,9 +158,9 @@ fn bar() {
158
158
fn baz() { ... } // this still parses fine!
159
159
```
160
160
161
-
### Lexer
161
+
### Tokenizer
162
162
163
-
The lexer is hand-written, and conceptually a deterministic finite automaton (DFA) that recognizes a regular language. Lexer generators or regular expressions are convenient, but don't offer as much flexibility as a hand-written lexer. It's also another dependency to maintain.
163
+
The tokenizer is hand-written, and conceptually a deterministic finite automaton (DFA) that recognizes a regular language. Lexer generators or regular expressions are convenient, but don't offer as much flexibility as a hand-written tokenizer. It's also another dependency to maintain.
164
164
165
165
Structurally, the lexer is a simple struct with two fields:
166
166
-`source`: a string slice of the user's source code, useful for accurate span tracking and error messages
0 commit comments