i learning common lisp @ moment , encountered huge roadblock. i've had assignment learn how create parser in common lisp. have managed implement grammar rules lexer alot of different sources online. cant on other hand seem figure out how implement symbol table.
this have far in regards of symbol table.
(defun symtab-add (state id) ;; *** add symbols symbol table *** ) (defun symtab-member (state id) ;; *** symbols in symbol table *** ) (defun symtab-display (state) (format t "------------------------------------------------------~%") (format t "symbol table is: ~s ~%" (pstate-symtab state)) (format t "------------------------------------------------------~%") )
as can see ive managed display part, if link me tutorial or give me code example or me super thankful.
all source code assignment: http://www.cs.kau.se/cs/education/courses/dvgc01/lisp/newstart.lsp
there multiple ways of implementing symbol table, varying levels of "suitable purpose" depending on exact needs. @ end of day, symbol table is, effectively, mapping "symbol name" something.
so data structure allows add things looking things should work. common implementations "use hash table" or "use alist" (the latter list of pairs on form (<symbol> . <data>)
).
Comments
Post a Comment