root/trunk/backmath/string_stuff.lisp

Revision 174, 0.8 kB (checked in by BCS, 1 year ago)

a few more cases in meta.lisp
a MAJOR fix in generate_case.lisp (it would generate bad code)
comment here and there

Line 
1 (load "meta.lisp")
2
3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4 ;; Convert an operator to it's name
5 ;;
6 ;; this is sued in the the construction
7 ;; of new expression-type
8
9 (defun op_name (a)
10     (cond 
11         ((equal a '+) "Add")
12         ((equal a '-) "Sub")
13         ((equal a '*) "Mul")
14         ((equal a '/) "Div")
15         ((equal a '+>) "AddA" )
16         ((equal a '->) "SubA" )
17         ((equal a '*>) "MulA" )
18         ((equal a '/>) "DivA" )
19         ((equal a '-r>) "SubAR" )
20         ((equal a '/r>) "DivAR" )
21         (t "%invlaid%")
22     )
23 )
24
25 (defun op_symb (a)
26     (cond 
27         ((equal a '+) "+")
28         ((equal a '-) "-")
29         ((equal a '*) "*")
30         ((equal a '/) "/")
31         ((equal a '+>) "+>")
32         ((equal a '->) "->")
33         ((equal a '*>) "*>")
34         ((equal a '/>) "/>")
35         ((equal a '-r>) "-r>")
36         ((equal a '/r>) "/r>")
37         (t "%invlaid%")
38     )
39 )
40
41 ;;; ?New-line constant
42 (DEFCONSTANT nl "
43 ")
Note: See TracBrowser for help on using the browser.