Changeset 12204 in project
 Timestamp:
 10/20/08 07:18:00 (12 years ago)
 Location:
 release/3/nemo/trunk
 Files:

 4 edited
Legend:
 Unmodified
 Added
 Removed

release/3/nemo/trunk/exprparser.scm
r12186 r12204 157 157 (stackpush! is lst) 158 158 (lambda () 159 (print "is = " (stack>list is))160 159 (if (stackempty? is) '*eoi* 161 160 (let* ((p (stackpop! is)) … … 167 166 ('? (tok (QUESTION))) 168 167 (': (tok (COLON))) 168 ('let (tok (LET))) 169 ('if (tok (IF))) 170 ('then (tok (THEN))) 171 ('else (tok (ELSE))) 169 172 ((? number?) (tok (NUM ,x))) 170 173 ((? symbol?) (tok (ID ,x))) … … 173 176 (else (errorp ": invalid input: " x)))) 174 177 (if (not (stackempty? is)) (tok (RPAREN)) '*eoi*)))) 175 (print " x = " x)176 (print " t = " t)177 178 t))))) 178 179 … … 180 181 181 182 (define (nemo:parsesymexpr lst) 182 (print "parsesymexpr: lst = " lst) 183 (cond ((number? lst) lst) 184 ((and (list? lst) (null? lst) '())) 185 (else (exprparser (makesymlexer lst parseerror) parseerror)))) 183 (let ((ret (cond ((number? lst) lst) 184 ((and (list? lst) (null? lst) '())) 185 (else (exprparser (makesymlexer lst parseerror) parseerror))))) 186 ret)) 187 186 188 187 189 
release/3/nemo/trunk/expr.grm
r12186 r12204 9 9 10 10 ;;  token definitions 11 ( ID NUM LET RPAREN11 ( ID NUM LET IF THEN ELSE RPAREN 12 12 (right: QUESTION COLON) 13 13 (left: < > =) … … 36 36 (expr QUESTION expr COLON expr) : `(if ,$1 ,$3 ,$5) 37 37 (LET LPAREN bnds RPAREN expr) : `(let ,(reverse $3) ,$5) 38 (IF expr THEN expr ELSE expr) : `(if ,$2 ,$4 ,$6) 38 39 (LPAREN expr RPAREN) : $2 39 40 ) … … 45 46 (bnds binding) : (cons $2 $1)) 46 47 47 (binding (LPAREN ID expr RPAREN) : (list $1 $2))48 (binding (LPAREN ID expr RPAREN) : (list (tokenvalue $2) $3)) 48 49 49 50 )) 
release/3/nemo/trunk/nemocore.scm
r12185 r12204 948 948 ((id '= expr) 949 949 (cond ((and (symbol? id) (or (symbol? expr) (number? expr) (list? expr))) 950 (envextend! id '(asgn) 'none `(rhs , expr))950 (envextend! id '(asgn) 'none `(rhs ,(parseexpr expr))) 951 951 (cons id qs)) 952 952 (else (nemo:error 'evalnemosystemdecls 
release/3/nemo/trunk/nemo.scm
r12185 r12204 161 161 (model (first model+nemo)) 162 162 (nemo (second model+nemo))) 163 (let ((model1 (nemo:hhtransformer model )))163 (let ((model1 (nemo:hhtransformer model parseexpr))) 164 164 (if (assoc 'depgraph options) (print "dependency graph: " ((nemo 'depgraph*) model1))) 165 165 (if (assoc 'exports options) (print "exports: " ((nemo 'exports) model1)))
Note: See TracChangeset
for help on using the changeset viewer.