We are trying to generate (in guile) a parser and a lexer that read characters from a string instead of stdin.
We started modifying the calculator example included in the code at http://code.google.com/p/lalr-scm/source/browse/trunk/calc.scm?r=52
The problem seems to be in the following line:
(let* ((location (make-source-location "*stdin*"
(port-line (current-input-port))
(port-column (current-input-port)) -1 -1))
We tried to define a new input port:
(let* ((location (make-source-location "*stdin*"
(port-line (open-input-string program))
(port-column (open-input-string program)) -1 -1))
and variable program was defined this way:
(define program
"int x = 2;
int y = 0;
y= x*(2+3);"
)
but it doesn't work, it still waits for standard input characters.
The documentation lacks details, so we can't figure out how we can solve this.
Thank you