Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Save/restore in PostScript

Guest
Oct 29, 2013 Oct 29, 2013

Hi,

I'm student of SPbSU. I have the work "Compiling PostScript's programs into Java byte-code" in this year.
Can anyone explain, how does save/restore work with composite objects? How does "save" do the snapshot, when many composite objects share the same value. Does it change references?  How does PostScript restore their references afterwards ?  It is necessary to understand because it's not clear how to realize these operators in Java.

Thanks,
Artur.

TOPICS
Programming
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 31, 2013 Oct 31, 2013
LATEST

You have an interesting challenge. The definition of the effect of save is in the PostScript Language Reference. There are no rules about how it is done. Because composite objects are large, they are not usually actually duplicated. There are a number of possible implementations, but one possibility is to store as part of the composite definition the level to which it belongs, then duplicate-on-write. You would probably need to implement your own primitive objects as classes, for all PostScript object types, rather than use the direct Java implementation because every type of PostScript object has special properties not available to Java (e.g. literal/executable). Really, you are writing a PostScript interpreter, be aware that this is likely to be many years of work.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines