Skip to content
Snippets Groups Projects
Commit cde29e16 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

add limit line to 1000 chars in rte gens

parent 3f2007a5
No related branches found
No related tags found
No related merge requests found
the top of the pushdown store: the top of the pushdown store:
the top of the pushdown store is on the left meaning that transition function (r, xyz) \in (q, 0, abc) will pop symbol a first than symbol b and then symbol c, push symbol z then symbol y and finally symbol x. The typical representation is a vector of symbols so for the pop part forward iterators begin and end should be used and for the push part reversed iterators rbegin and rend should be used. This is very much similar to grammars where context free grammars generating a string or a sentential from a rules say A -> aBb| c product a^ncb^n. First b is pushed then B and finally a. the top of the pushdown store is on the left meaning that transition function (r, xyz) \in (q, 0, abc) will pop symbol a first than symbol b and then symbol c, push symbol z then symbol y and finally symbol x. The typical representation is a vector of symbols so for the pop part forward iterators begin and end should be used and for the push part reversed iterators rbegin and rend should be used. This is very much similar to grammars where context free grammars generating a string or a sentential from a rules say A -> aBb| c product a^ncb^n. First b is pushed then B and finally a.
String parsers cannot process correctly text files with more than 4096 characters on a single line at least on some systems. There is a bug in unget and putback function on istream.
...@@ -3,10 +3,17 @@ import random ...@@ -3,10 +3,17 @@ import random
import sys import sys
   
MAXD = 200 MAXD = 200
MAXL = 1000
L = 0
   
def p(c): def p(c):
print(c, end='') print(c, end='')
global L
L = L + 1
   
if L > MAXL:
L = 0
print ("\n", end='')
   
def SCont(depth): def SCont(depth):
if depth > MAXD or random.randint(0,1) == 0: if depth > MAXD or random.randint(0,1) == 0:
......
...@@ -3,9 +3,17 @@ import random ...@@ -3,9 +3,17 @@ import random
import sys import sys
   
MAXD = 200 MAXD = 200
MAXL = 1000
L = 0
   
def p(c): def p(c):
print(c, end='') print(c, end='')
global L
L = L + 1
if L > MAXL:
L = 0
print ("\n", end='')
   
   
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -3,9 +3,17 @@ import random ...@@ -3,9 +3,17 @@ import random
import sys import sys
   
MAXD = 200 MAXD = 200
MAXL = 1000
L = 0
   
def p(c): def p(c):
print(c, end='') print(c, end='')
global L
L = L + 1
if L > MAXL:
L = 0
print ("\n", end='')
   
   
def S(depth): def S(depth):
......
...@@ -3,9 +3,17 @@ import random ...@@ -3,9 +3,17 @@ import random
import sys import sys
   
MAXD = 200 MAXD = 200
MAXL = 1000
L = 0
   
def p(c): def p(c):
print(c, end='') print(c, end='')
global L
L = L + 1
if L > MAXL:
L = 0
print ("\n", end='')
   
   
def S(depth): def S(depth):
......
...@@ -3,9 +3,17 @@ import random ...@@ -3,9 +3,17 @@ import random
import sys import sys
   
MAXD = 200 MAXD = 200
MAXL = 1000
L = 0
   
def p(c): def p(c):
print(c, end='') print(c, end='')
global L
L = L + 1
if L > MAXL:
L = 0
print ("\n", end='')
   
   
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -3,9 +3,17 @@ import random ...@@ -3,9 +3,17 @@ import random
import sys import sys
   
MAXD = 200 MAXD = 200
MAXL = 1000
L = 0
   
def p(c): def p(c):
print(c, end='') print(c, end='')
global L
L = L + 1
if L > MAXL:
L = 0
print ("\n", end='')
   
   
def SL(depth): def SL(depth):
......
...@@ -3,9 +3,17 @@ import random ...@@ -3,9 +3,17 @@ import random
import sys import sys
   
MAXD = 200 MAXD = 200
MAXL = 1000
L = 0
   
def p(c): def p(c):
print(c, end='') print(c, end='')
global L
L = L + 1
if L > MAXL:
L = 0
print ("\n", end='')
   
   
def SCont(depth): def SCont(depth):
......
...@@ -3,9 +3,17 @@ import random ...@@ -3,9 +3,17 @@ import random
import sys import sys
   
MAXD = 200 MAXD = 200
MAXL = 1000
L = 0
   
def p(c): def p(c):
print(c, end='') print(c, end='')
global L
L = L + 1
if L > MAXL:
L = 0
print ("\n", end='')
   
   
def S(depth): def S(depth):
......
...@@ -3,9 +3,17 @@ import random ...@@ -3,9 +3,17 @@ import random
import sys import sys
   
MAXD = 200 MAXD = 200
MAXL = 1000
L = 0
   
def p(c): def p(c):
print(c, end='') print(c, end='')
global L
L = L + 1
if L > MAXL:
L = 0
print ("\n", end='')
   
   
def S(depth): def S(depth):
......
...@@ -47,6 +47,8 @@ function log { ...@@ -47,6 +47,8 @@ function log {
cat $2 >> $LOGFILE cat $2 >> $LOGFILE
echo "rte: " >> $LOGFILE echo "rte: " >> $LOGFILE
cat $3 >> $LOGFILE cat $3 >> $LOGFILE
echo "out: " >> $LOGFILE
echo $4 >> $LOGFILE
} }
   
# $1 = genfile # $1 = genfile
...@@ -64,7 +66,7 @@ function runAcceptTest { ...@@ -64,7 +66,7 @@ function runAcceptTest {
fi fi
   
if [ $RET != 0 ]; then # fail if [ $RET != 0 ]; then # fail
log "$PATTERN" "$2" "$3" log "$PATTERN" "$2" "$3" "$OUT"
echo -n "" echo -n ""
fi fi
   
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment