Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #1403
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Helge Blischke <h.blischke@acm.org> |
| Newsgroups | comp.lang.postscript |
| Subject | Re: ps scanner - finishing touches |
| Followup-To | comp.lang.postscript |
| Date | Fri, 21 Jun 2013 11:22:40 +0200 |
| Lines | 41 |
| Message-ID | <b2ikbcFotkaU1@mid.individual.net> (permalink) |
| References | <b0b98f62-aa17-4671-a030-d74a174ce326@googlegroups.com> <ba3d66b6-f29c-41b6-8e83-f1e53fa56f9c@googlegroups.com> <32b7fc2b-80d9-4855-887f-dce2f1bb9f54@googlegroups.com> <fc5ff9d0-21a4-4396-8b83-e5bd171bd37c@googlegroups.com> <0e4500fe-648e-4362-b4cf-9e34a5384da2@googlegroups.com> <b0b2f155-3cb4-4a1a-af86-3ab81240f89b@googlegroups.com> <1c6b4a1e-c7a6-423e-9457-6a1e7da172d4@googlegroups.com> <815bcdb9-88ae-4104-adf6-97d533e55930@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Content-Transfer-Encoding | 8Bit |
| X-Trace | individual.net 7X4KN9fFMrYysSFx0fsRAw+Ehmet8EZa4+tiwo0ZWMSO97G7Zg |
| Cancel-Lock | sha1:TIkFGHReMF65fi6vyGYihrErdn8= |
| User-Agent | KNode/0.99.01 |
| Xref | csiph.com comp.lang.postscript:1403 |
Followups directed to: comp.lang.postscript
Show key headers only | View raw
luser- -droog wrote: > The scanner is working and mostly complete. Re-wrote most > of the postscript to remove local dictionaries. This should make the > scanner re-entrant. http://code.google.com/p/xpost/source/browse/optok.c > > Remaining issues: //immediate names. A naïve approach would be to add a > variable to toke_dict to track whether we're inside a procedure (so > immediate names are allowed) or outside (where immediate names are > disallowed). Where does the PLRM state that immediate evaluated names are disaloowed outside of procedures???? > But grok_dict might be shared by several contexts. Another > option is to push a new dictionary with this name. Perhaps toke_dict > defines /in_executable_array to false, but when scanning a proc, do > `<</in_executable_true>>begin` ... `end` around the recursive calls. This > approach seems viable. > > Another piece is ASCII85. I don't have the energy right now. :) > > Another piece (that I'm putting off still, but the day looms closer) is > Binary encodings. > > But the piece standong in the way of running the interpreter > interactively, is dealing with the file/string polymorphism in the token > operator. I've kept this scanner code under the name `toke` as it's > clearly not a full implementation of `token`, since it only accepts > strings. But files can easily be read-off into strings. It's called > buffering and happens all the time. So my thought is, to use the function > that implements the %statementedit special file to read-off a statement > into a string, then call `toke` on that string, and stash the remainder > (the returned substring) into the file object's payload structure (the > shared part), modifying all file-reading operators to read first from this > lookahead_buffer, if present. > > This appears to let me re-use a lot of existing code to get this working. > But something about it leaves me uneasy. Adding a buffer to the file may > have unforeseen consequences. Or so I fear. Helge
Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
ps scanner - finite state machines luser- -droog <mijoryx@yahoo.com> - 2013-03-24 23:08 -0700
Re: ps scanner - finite state machines, more luser- -droog <mijoryx@yahoo.com> - 2013-03-30 09:40 -0700
Re: ps scanner - finite state machines, more luser- -droog <mijoryx@yahoo.com> - 2013-03-31 00:59 -0700
Re: ps scanner - finite state machines, + hexstrings and names luser- -droog <mijoryx@yahoo.com> - 2013-04-22 23:33 -0700
Re: ps scanner - finite state machines, + hexstrings and names luser- -droog <mijoryx@yahoo.com> - 2013-06-02 03:21 -0700
Re: ps scanner - finite state machines, + hexstrings and names luser- -droog <mijoryx@yahoo.com> - 2013-06-09 12:16 -0700
Re: ps scanner - finite state machines, + hexstrings and names luser- -droog <mijoryx@yahoo.com> - 2013-06-11 23:40 -0700
Re: ps scanner - finishing touches luser- -droog <mijoryx@yahoo.com> - 2013-06-21 00:56 -0700
Re: ps scanner - finishing touches Helge Blischke <h.blischke@acm.org> - 2013-06-21 11:22 +0200
Re: ps scanner - finishing touches Helge Blischke <h.blischke@acm.org> - 2013-06-21 11:22 +0200
Re: ps scanner - finishing touches luser- -droog <mijoryx@yahoo.com> - 2013-06-21 09:20 -0700
Re: ps scanner - finishing touches luser- -droog <mijoryx@yahoo.com> - 2013-07-27 00:56 -0700
Re: ps scanner - finishing touches luser- -droog <mijoryx@yahoo.com> - 2014-01-25 23:32 -0800
Re: ps scanner - finishing touches luser droog <luser.droog@gmail.com> - 2016-11-28 08:12 -0800
csiph-web