From highfly22 at gmail.com Tue Jun 3 12:53:43 2008 From: highfly22 at gmail.com (highfly joe) Date: Tue, 3 Jun 2008 20:53:43 +0800 Subject: [fucc-devel] Unkown terminal error when using intern Message-ID: <662746420806030553m670d1ae7xd75df04ab60927c1@mail.gmail.com> Hi, I wrote lexer return (values (intern "{") (intern "{")) but when using LR parser, the following error occurs. I have red the code expanded by macro, and found that the second argument is evaluated, which should be (intern "{"). If the lexer return (values '{ '{), it works. So is there any way to use string to symbol function in lexer? Thanks, Haiwei Unknown terminal { [Condition of type SIMPLE-ERROR] Restarts: 0: [ABORT] Return to SLIME's top level. 1: [TERMINATE-THREAD] Terminate this thread (#) Backtrace: 0: ((LAMBDA (#:G203 #:G205 #:G206)) 6 # (0 # # #2A((# # #S(FUCC::ERROR-ACTION) #S(FUCC::ERROR-ACTION) #S(FUCC::ERROR-ACTION) #S(FUCC::ERROR-ACTION) #S(FUCC::ERROR-ACTION) # #S(FUCC::ERROR-ACTION) # ...) (#S(FUCC::ERROR-ACTION) # # # # # # #S(FUCC::ERROR-ACTION) #S(FUCC::ERROR-ACTION) # ...) (#S(FUCC::ACCEPT-ACTION) #S(FUCC::ERROR-ACTION) ..)))) Locals: SB-DEBUG::ARG-0 = 6 SB-DEBUG::ARG-1 = : SB-DEBUG::ARG-2 = (0 # # -------------- next part -------------- An HTML attachment was scrubbed... URL: From lispnik at gmail.com Thu Jun 5 06:40:40 2008 From: lispnik at gmail.com (Ivan Boldyrev) Date: Thu, 05 Jun 2008 13:40:40 +0700 Subject: [fucc-devel] Unkown terminal error when using intern In-Reply-To: <662746420806030553m670d1ae7xd75df04ab60927c1@mail.gmail.com> (highfly joe's message of "Tue, 3 Jun 2008 20:53:43 +0800") References: <662746420806030553m670d1ae7xd75df04ab60927c1@mail.gmail.com> Message-ID: <3bk5h48jvb.fsf@ibhome.cgitftp.uiggm.nsc.ru> On 10225 day of my life highfly joe wrote: > So is there any way to use string to symbol function in lexer? Do you mean "in parser"? Parser have to know all terminals and non-terminals in compile time (to build internal tables). Arguments of defparser are not evaluated for this reason (To avoid confusion, warning should be signaled if you pass a non-atom in terminal list; I will improve it in future version). You may use read-time evaluation intoduced by #. read macro: (fucc:defparser *test* s ; Initial ;; List of terminals: (term1 term2 #.(intern "{"))) ;; List of rules: (s -> term2 term1 -> #.(intern "{")))) Or even (fucc:defparser *test* s ; Initial ;; List of terminals: (term1 term2 #1= #.(intern "{"))) ;; List of rules: (s -> term2 term1 -> #1#)) But isn't simple { better? I also prefer using keywords for terminals: :{ works fine even if looks somewhats dreary, but it is compensated by :} terminal. -- Ivan Boldyrev XML -- new language of ML family. From iboldyrev at common-lisp.net Tue Jun 24 17:13:31 2008 From: iboldyrev at common-lisp.net (Ivan Boldyrev) Date: Wed, 25 Jun 2008 00:13:31 +0700 Subject: [fucc-devel] Unstable version of FUCC with error recovery Message-ID: The error recovery scheme is modelled after GNU bison. See http://www.common-lisp.net/project/fucc/files/fucc_0.2.1-alpha-20080624.tar.gz No documentation yet, but see examples. -- Ivan Boldyrev Sorry my terrible English, my native language is Lisp!