Skip to content

Commit 8269521

Browse files
committed
Changed syntax from bo to ci for or boolean operator
1 parent ada4423 commit 8269521

File tree

6 files changed

+20
-24
lines changed

6 files changed

+20
-24
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ toz cyslo i = 1 pyco
6060
### Podmínky ###
6161
Pro vytvoření podmínky použijeme konstrukt **kaj** - **kajtez** - **boinak**
6262

63-
Jednotlivé výrazy můžeme spojovat pomocí boolenovského **bo** (or) a **aj** (and)
63+
Jednotlivé výrazy můžeme spojovat pomocí boolenovského **ci** (or) a **aj** (and)
6464

6565
```
6666
#!java
@@ -69,7 +69,7 @@ toz bul b pyco
6969
7070
//...
7171
72-
kaj (a == fajne bo b == fajne){
72+
kaj (a == fajne ci b == fajne){
7373
// ...
7474
} kajtez (a == nyt aj b == fajne){
7575
// ...

examples/Expressions/Expressions.cyp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ tryda Ostrava {
77
88
toz bul b pyco
99
10-
b = (i == 1 aj (i == 4 bo 1<5) ) pyco
10+
b = (i == 1 aj (i == 4 ci 1<5) ) pyco
1111
1212
Konzola.pravit(b) pyco
1313
14-
kaj (i == 1 aj (j == 1 bo (1 == 1) ) ) {
14+
kaj (i == 1 aj (j == 1 ci (1 == 1) ) ) {
1515
i = i + 1 * 4 / 10 % 4 - 5 pyco
1616
} kajtez (i == 2){
1717
i = i + j pyco

src/main/java/cz/cvut/fit/ostrajava/Parser/OSTRAJava.jj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ TOKEN : /* OPERATORS */
205205
| < LE: "<=" >
206206
| < GE: ">=" >
207207
| < NE: "!=" >
208-
| < SC_OR: "bo" >
208+
| < SC_OR: "ci" >
209209
| < SC_AND: "aj" >
210210
| < PLUS: "+" >
211211
| < MINUS: "-" >
@@ -1240,7 +1240,7 @@ void ConditionalOrExpression() :
12401240
jjtn001.jjtSetFirstToken(getToken(1));
12411241
}
12421242
try {
1243-
/*@egen*/ "bo"/*@bgen(jjtree)*/
1243+
/*@egen*/ "ci"/*@bgen(jjtree)*/
12441244
} finally {
12451245
if (jjtc001) {
12461246
jjtree.closeNodeScope(jjtn001, true);

src/main/java/cz/cvut/fit/ostrajava/Parser/OSTRAJava.jjt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ TOKEN : /* OPERATORS */
201201
| < LE: "<=" >
202202
| < GE: ">=" >
203203
| < NE: "!=" >
204-
| < SC_OR: "bo" >
204+
| < SC_OR: "ci" >
205205
| < SC_AND: "aj" >
206206
| < PLUS: "+" >
207207
| < MINUS: "-" >
@@ -521,7 +521,7 @@ void ConditionalExpression() :
521521
void ConditionalOrExpression() :
522522
{}
523523
{
524-
ConditionalAndExpression() ( "bo" #OrOperator ConditionalAndExpression() )*
524+
ConditionalAndExpression() ( "ci" #OrOperator ConditionalAndExpression() )*
525525
}
526526

527527
void ConditionalAndExpression() :

src/main/java/cz/cvut/fit/ostrajava/Parser/OSTRAJavaParserConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public interface OSTRAJavaParserConstants {
237237
"\"<=\"",
238238
"\">=\"",
239239
"\"!=\"",
240-
"\"bo\"",
240+
"\"ci\"",
241241
"\"aj\"",
242242
"\"+\"",
243243
"\"-\"",

src/main/java/cz/cvut/fit/ostrajava/Parser/OSTRAJavaParserTokenManager.java

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,12 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1){
2424
}
2525
return -1;
2626
case 1:
27-
if ((active0 & 0x4000000L) != 0L || (active1 & 0x180L) != 0L)
27+
if ((active1 & 0x180L) != 0L)
2828
return 28;
29-
if ((active0 & 0x7ffffbfffe00L) != 0L || (active1 & 0x40000L) != 0L)
29+
if ((active0 & 0x7ffffffffe00L) != 0L || (active1 & 0x40000L) != 0L)
3030
{
31-
if (jjmatchedPos != 1)
32-
{
33-
jjmatchedKind = 78;
34-
jjmatchedPos = 1;
35-
}
31+
jjmatchedKind = 78;
32+
jjmatchedPos = 1;
3633
return 28;
3734
}
3835
return -1;
@@ -300,9 +297,9 @@ private int jjMoveStringLiteralDfa0_0(){
300297
case 97:
301298
return jjMoveStringLiteralDfa1_0(0x0L, 0x100L);
302299
case 98:
303-
return jjMoveStringLiteralDfa1_0(0x2004000200L, 0x80L);
300+
return jjMoveStringLiteralDfa1_0(0x2004000200L, 0x0L);
304301
case 99:
305-
return jjMoveStringLiteralDfa1_0(0x4d000100000L, 0x0L);
302+
return jjMoveStringLiteralDfa1_0(0x4d000100000L, 0x80L);
306303
case 100:
307304
return jjMoveStringLiteralDfa1_0(0x90220000000L, 0x0L);
308305
case 102:
@@ -363,6 +360,10 @@ else if ((active1 & 0x40L) != 0L)
363360
return jjMoveStringLiteralDfa2_0(active0, 0x90100000000L, active1, 0L);
364361
case 104:
365362
return jjMoveStringLiteralDfa2_0(active0, 0x8000100000L, active1, 0L);
363+
case 105:
364+
if ((active1 & 0x80L) != 0L)
365+
return jjStartNfaWithStates_0(1, 71, 28);
366+
break;
366367
case 106:
367368
if ((active1 & 0x100L) != 0L)
368369
return jjStartNfaWithStates_0(1, 72, 28);
@@ -374,11 +375,6 @@ else if ((active1 & 0x40L) != 0L)
374375
case 110:
375376
return jjMoveStringLiteralDfa2_0(active0, 0x200000000000L, active1, 0L);
376377
case 111:
377-
if ((active1 & 0x80L) != 0L)
378-
{
379-
jjmatchedKind = 71;
380-
jjmatchedPos = 1;
381-
}
382378
return jjMoveStringLiteralDfa2_0(active0, 0x100004064000L, active1, 0L);
383379
case 114:
384380
return jjMoveStringLiteralDfa2_0(active0, 0x889000L, active1, 0L);
@@ -1413,7 +1409,7 @@ private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, lo
14131409
"\163\167\151\164\143\150", "\143\141\163\145", "\144\145\146\141\165\154\164", "\146\157\162",
14141410
"\151\156\163\164\141\156\143\145\157\146", "\151\155\160\157\162\164", null, null, null, null, null, null, null, null,
14151411
"\50", "\51", "\173", "\175", "\133", "\135", "\54", "\56", "\75", "\76", "\74",
1416-
"\41", "\75\75", "\74\75", "\76\75", "\41\75", "\142\157", "\141\152", "\53", "\55",
1412+
"\41", "\75\75", "\74\75", "\76\75", "\41\75", "\143\151", "\141\152", "\53", "\55",
14171413
"\52", "\57", "\45", null, null, null, "\72", "\153\141\152\164\145\172\40\50", };
14181414
protected Token jjFillToken()
14191415
{

0 commit comments

Comments
 (0)