Compare commits
No commits in common. "2025-predrok/01-multiline-comments" and "master" have entirely different histories.
2025-predr
...
master
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@ out/
|
|||||||
*.zip
|
*.zip
|
||||||
prg/**/*.ast
|
prg/**/*.ast
|
||||||
prg/**/*.out
|
prg/**/*.out
|
||||||
|
prg/**/*.pins25
|
26
grammar.txt
26
grammar.txt
@ -69,28 +69,4 @@ restinits -> COMMA initializer restinits | .
|
|||||||
initializer -> INTCONST intconstmult | CHARCONST | STRINGCONST .
|
initializer -> INTCONST intconstmult | CHARCONST | STRINGCONST .
|
||||||
intconstmult -> MUL const | .
|
intconstmult -> MUL const | .
|
||||||
|
|
||||||
const -> INTCONST | CHARCONST | STRINGCONST .
|
const -> INTCONST | CHARCONST | STRINGCONST .
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
|
|
||||||
//LEFT ASOC.
|
|
||||||
exp0 = exp0 op other | other
|
|
||||||
|
|
||||||
|
|
|
||||||
v
|
|
||||||
|
|
||||||
exp0 = other exp0'
|
|
||||||
exp0' = op other exp0' | .
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//RIGHT ASOC.
|
|
||||||
exp0 = other op exp0 | other
|
|
||||||
|
|
||||||
|
|
|
||||||
v
|
|
||||||
|
|
||||||
exp0 = other exp0'
|
|
||||||
exp0' = op exp0 | .
|
|
@ -1,5 +0,0 @@
|
|||||||
// line1 --
|
|
||||||
line2 -----x
|
|
||||||
line3
|
|
||||||
|
|
||||||
fun main() = 0
|
|
@ -247,13 +247,7 @@ public class LexAn implements AutoCloseable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder();
|
while (buffChar != '\n' && buffChar != -1) {
|
||||||
|
|
||||||
while (buffChar != -1) {
|
|
||||||
if (buffChar == '\n' && !builder.toString().endsWith("--")) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
builder.append((char) buffChar);
|
|
||||||
nextChar();
|
nextChar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user