Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
2
2022fall-Compiler_CMinus
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李晓奇
2022fall-Compiler_CMinus
Commits
41d4a2b8
Commit
41d4a2b8
authored
Sep 22, 2021
by
Kai Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[lab1] fix doc
parent
4eae2dbe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Documentations/1-parser/README.md
Documentations/1-parser/README.md
+6
-6
No files found.
Documentations/1-parser/README.md
View file @
41d4a2b8
...
...
@@ -173,7 +173,7 @@ int main(void) {
```
sh
$
cd
2020fall-Compiler_CMinus
# 词法测试
$
./build/lexer ./tests/parser/
easy
/local-decl.cminus
$
./build/lexer ./tests/parser/
normal
/local-decl.cminus
Token Text Line Column
(
Start,End
)
280 int 0
(
0,3
)
284 main 0
(
4,8
)
...
...
@@ -182,7 +182,7 @@ int main(void) {
273
)
0
(
13,14
)
...
# 语法测试
$
./build/parser ./tests/parser/
easy
/local-decl.cminus
$
./build/parser ./tests/parser/
normal
/local-decl.cminus
>
--
+ program
|
>
--
+ declaration-list
| |
>
--
+ declaration
...
...
@@ -194,11 +194,11 @@ int main(void) {
```
sh
$
cd
2020fall-Compiler_CMinus
$
export
PATH
=
$(
realpath
./build
)
$
export
PATH
=
"
$(
realpath
./build
)
:
$PATH
"
$
cd
tests/parser
$
mkdir
output.easy
$
parser easy/
array.cminus
>
output.easy/array
.cminus
$
diff output.easy/
array.cminus syntree_easy_std/array
.syntax_tree
$
parser easy/
expr.cminus
>
output.easy/expr
.cminus
$
diff output.easy/
expr.cminus syntree_easy_std/expr
.syntax_tree
[
输出为空,代表没有区别,该测试通过]
```
...
...
@@ -209,7 +209,7 @@ int main(void) {
[
info] Analyzing FAIL_id.cminus
error at line 1 column 6: syntax error
...
[
info] Analyzing
local-decl
.cminus
[
info] Analyzing
id
.cminus
$
./test_syntax.sh easy
yes
...
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment