Home

Toward higher-order BibTeXing

image

Contents

1. 17 18 19 20 L21 22 ISO ISO R77 R f rence bibliographiques El ments essentiels 1958 Java security 2003 http java sun com security Ronan Keryell Publication list http www lit enstb org keryell publications biblio html Larousse 2004 Le Petit Larousse Illustr volume 1 Larousse 2002 BIEX a document preparation system http wuw latex project org 2004 Steve Lawrence C Lee Giles and Kurt Bollacker Citeseer the NEC research institute scientific liter ature digital library 2002 http citeseer nj nec com 23 Oren Patashnik BibTpX ing 1988 24 Todd A Proebsting and Scott A Watterson 488 Krakatoa Decompilation in Java does bytecode reveal source In Third USENIX Conf Object Oriented Technologies and Systems COOTS pages 185 197 1997 25 Mark Weiser Thomas Widmann 28 H P V Vliet Mocha Java bytecode decompiler 2003 http www brouhaha com eric computers mocha html Program slicing IEEE Transac tions on Software Engineering 10 4 352 357 July 1984 Bibulus a Perl XML re placement for Bib TFX In EuroTpX 2003 this vol ume ENST Bretagne France June 2003 Byung Sun Yang Soo Mook Moon and Erik R Altman LaTTe A Java VM just in time compiler with fast and efficient register allocation In Zn ternational Conference on Parallel Architectures and Compilation Techniques pages 128 13
2. Fic 6 Bistro architecture e first we use the BsT parser to convert a BsT file into a BsT abstract syntax tree asT with a Sablecc grammar e then in the tree translator the BST Ast is trans formed to a Java like ast useful information from the tree is gathered like function names global variables Func tions are analyzed to decide if the stack can be removed and if so what is the number of input output parameters unlike BST Java is a type based language so we need to know the type of every variable in the non stack based session But in some cases it is very difficult to find this type so if we cannot determine it we use instead a Ce object an object that can store both an integer and a string with this data the BST Asr is translated into a Java ast e later the Java asT tree is optimized with some clas sical transformations such as constant propagation dependencies reduction transformation of integer into boolean in the condition block dead code elim ination peephole optimizations o at last a Java file is written by the prettyprinter and the new Java BiBTEX style can be compiled and used Globally some gst code like FUNCTION or pop 1 gt skip if will be converted into Java as public int or int iO int il if i1 gt 0 10 1 return i0 For most users and style designers since the second block of code has been optimiz
3. Martin BRISBARRE Aude Jacquor Olivier Muzzer Mathieu SERVILLAT and Mohamed Firass Squazzi Houssaini who extended it PAP 5J in 2001 and Sergio Grau Puerto for the first review of stack removal Bibliography 1 Per Abrahamsen and David Kastrup AUCTEX An integrated TEX I TEX environment 2004 http www gnu org software auctex 2 Preston Briggs Register allocation via graph col oring Technical Report TRg2 183 Rice Univer sity 24 1992 Bis TEX Toward Higher order Bis EXing 3 David Callahan and Brian Koblenz Register al location via hierarchical graph coloring In SIG PLAN 91 Conference on Programming Language Design and Implementation pages 192 203 1991 4 Fred C Chow Minimizing register usage penalty at procedure calls In SIGPLAN 88 Conference on Programming Language Design and Implementa tion pages 45 58 1988 5 Patrick W Daly The custom bib package Max Planck Institut f r Aeronomie 2004 http www ctan org tex archive macros latex contrib custom bib 6 Bruce D Arcus and John J Lee Open standards and software for bibliographies and cataloging October 2003 http wwwsearch sourceforge net bib openbib html 7 Carsten Dominik and Stephen Eglen RefTEX Support for BIFX Labels References and Cita tions with GNU Emacs 2004 http remote science uva nl dominik Tools reftex 8 Emmanuel Donin de Rosi re From stack removing in stack based languages t
4. normally read from the aux file to pick cite information could be extended to deal with OpenOffice DocBook or Word documents Prettyprinters Since B s TEX can be seen as a pa rameterized compiler that deals with some internal bib liographical representations it could be nice to target other output formats than XTX such as an OpenOffice DocBook or Word document syntax or to automat ically internationalize a style from one language to an other TU Gboat Volume 24 2003 No 3 Proceedings of Euro TEX 2003 475 Fabien Dagnat Ronan Keryell and Youssef Aoun Laura Barrero Sastre Emmanuel Donin de Rosi re Nicolas Torneri In an easier way B1B EX could be used to trans late a bib file to another bibliography database for mat or apply some basic manipulations on bibliographical databases sorting merging Style transformation More generally adding some features to already existing styles is useful to revive some of the old fashioned styles for instance adding new url records to old styles written before the Internet wave To make a bibliographical database or a researcher publication list 19 available on the Internet it could be useful to be able to fetch close to the typeset biblio graphical notice the bib record itself that was used to generate the notice if someone wants to cite it in her ar ticle This could be done in any style by using an appro priate plugin Metaplugins Whereas BIs TEX did
5. A ba sic block is a set of instructions which contains only simple primitives like literals constants variables operators and stack manipulation instructions So a basic block does not contain any branch or jump all primitives are executed sequentially Then raFTs builds a data flow graph of this basic block After that it converts the Forth primitives into mnemonic instructions and transforms all stack items into unlimited pseudo registers So all stack accesses within a basic block have been eliminated and the pac Directed Acyclic Graph is now an instruction pac Then an in struction scheduler orders the nodes of the instruction DAG i e it transforms the pac into a list This list is optimized to reduce register dependencies between in structions Now we have a set of mnemonic blocks but we have to connect them with control structures Control flow splits IF WHILE and UNTIL are easy to transform but control flow joins ENDIF and BEGIN are a little harder because the corresponding stack items of the joining ba sic blocks usually do not reside in the same register So RAFTS needs to move some values around to have the same structure In order to have faster output code three good reg ister allocation algorithms are proposed graph coloring register allocation 2 hierarchical graph coloring 3 and interprocedural allocators 4 Another stack elimination in a compiler can be found in Java compilers Today faster and
6. Now we consider the Bistro compiler for translating BsT to Java See figure 4 The B1BTEX stack based input language Bis TRX bst files use a stack based language it is a type of lan TUGboat Volume 24 2003 No 3 Proceedings of Euro TFX 2003 477 Fabien Dagnat Ronan Keryell and Youssef Aoun Laura Barrero Sastre Emmanuel Donin de Rosi re Nicolas Torneri bst compiler NEVER ES Fic 4 Compilation work flow guage where you push the data to manipulate on a stack Also functions store their results on this stack The syn tax uses a reverse polish notation also called postfix no tation For example to compute 2 3 you first push 2 and 3 on the stack and then call the add operator so you have to write something like this 2 3 Some stack based languages We may cite as stack based programming languages e Forth used in many fields especially embedded control applications e PostScript used primarily in typesetting and other display purposes Because the majority of Post Script code is written by programs it can also be regarded as an intermediate language e RPL reverse polish Lisp the language of the HP 48 calculator It is a run time type checked language with mathematical data types it is on a calculator and has a Forth like syntax e the BiBIYX style BsT language the stack based language used for processing BiBIEX databases Although stack based languages are sometimes used as
7. TFX because the Java language TUGboat Volume 24 2003 No 3 Proceedings of Euro TFX 2003 485 Fabien Dagnat Ronan Keryell and Youssef Aoun Laura Barrero Sastre Emmanuel Donin de Rosi re Nicolas Torneri is far more expressive higher level and comprehensible than the sst language In order to help developers who want to reuse an old style they can ask BisTro to optimize its output code Nevertheless as we have just seen these optimizations do not decrease the execution time of the bibliography generation mainly because the Java compiler also opti mizes the code when we compile it So these optimiza tions are mainly useful for a style designer as a reverse engineering framework We can see in the histogram in figure g that these optimizations decrease the size of the java style file by 22 and the size of the class file by 16 So they re duce the length of the code at least it is usually easier to understand shorter code but also increases its legibility as we have seen in the optimization code examples We can also note that the optimized class files has almost the same size as the original bst files But since these class files were automatically generated we can imagine that hand made B1B TEX style files will be smaller than Bris TEX ones so they will be more easily downloadable and sharable Related work There are many other open tools available to deal with bibliographies 6 but to our knowledge non
8. files to the Bibulus format The format is typed more strongly to ease further internationalization For example the gender of the author is defined to allow for grammatical variation in some languages Although Bibulus is right now targeted at the ATEX environment other input or output formats could easily be added Some style parameters can be written directly in the source document to change the behavior and new items can be added to a citation to override or specialize some points of the bibliography for this particular document or to add an annotation in the current context and lan guage 3 The extensibility is based on two methods First as in BiBIEX there are many hooks to enable the style programmer to modify the standard behavior of Bibulus such as rewriting things in the parser and so on Next since Perl is also an object oriented language the style programmer can override some methods of Bibulus ob jects But since there is no security model in Perl beyond tainted mode it seems difficult to allow for secure exe cution of styles from the hostile world Conclusion BiBIEX is an extendable tool dealing with the bibli ographical area of electronic documents It aims at ex tending the well known BrsTX in the I TEX world by adding modern features such as Unicode document en coding Internet capabilities scalability to future usages and future tools through plugin mechanisms and at the same time to remain compati
9. not evolve for many years Bis T X should rapidly evolve according present programming and Internet standards A natural way is to use mobile code concepts in BiBTEX code that can also be downloaded by a plugin itself Since it is a plugin that can fetch from the network other plugins it has been nicknamed meta plugin in BirTEX One can embrace various future uses of this concept First to write this paper we could have picked all the B gs TEX bibliographical style from the TU Gboat web site On the BipTpX web site we could have a page referencing all the bibliographical databases available on the Internet A plugin associated with this page could download other plugins to deal with each database we are interested in If a new typesetting tool is introduced its au thor could provide on her site some plugin material for Bi8IEX to be compatible with that new tool The Bi8IEX user would only provide to the meta plugin the plugin address We will see in Security model how to circumvent the obvious security issues related to this kind of mobile code in the wild Plugin syntax To remain close to the existing BIEX and B B IEX interaction syntax we do not add new BIEX macros but rely on the current ones merely adding special keywords inside the bibliography and bibliographystyle macros Of course plugins can also be included from the B1B8TEX invocation line or with another mechanism to suit other input form
10. not for the style programmer s brain The tool lacks extensibility and such modern features as network awareness This is why we began the B B I X project in 1999 as a way to extend the B sT X functionalities without throwing away the Bris IX compatibility data bases and styles In this article we present first the basic functional ities in BiBTEX B B TEX functionalities then the software architecture in Software architecture of BiB8IEX with some emphasis on our Bistro compiler Software architecture of the Bistro BsT to Java com piler and the plugin architecture Plugins and meta plugins BrBlpX functionalities The B1BTEX name has been chosen to assert a Bip TEX compatibility with an improvement comparable to the object oriented add on from the C to C languages The ordinary Bi8TEX user does not have to embrace the object oriented architecture of BinTEX but this is not the case for the style programmer and of course the BiBTEX programmers TUGboat Volume 24 2003 No 3 Proceedings of Euro TEX 2003 473 Fabien Dagnat Ronan Keryell and Youssef Aoun Laura Barrero Sastre Emmanuel Donin de Rosi re Nicolas Torneri BreTgX compatibility Since B1BTEX is a very widely used tool compatibility with the old B B TEX is a re quirement BiBIYX usage is simple the first thing to do is to create the database file a file with a bib extension or better to use a
11. optimizations because the aim of this is to increase legibility rather than speed execu tion Another reason for using simple optimizations is that the input code was written by human programmers in a not very understandable language so they tried to write this code cleanly We use eight different functions for this e an if optimizer simply removes all the empty then or else blocks found in a plain Bst code e a copy and constant propagation function removes most of the variables generated instead of stack us age This increases the quality of the next phase dead code elimination e a dead code elimination function is associated with the propagation optimization to remove many use less definitions because it deletes all write after write dependencies e a boolean translator since in the ssr language there is no boolean type this optimization tries to transform integer to boolean in if and while conditions For example it will transform if BuiltIn equal i1 i2 gt O to if il i2 e other small optimizations such as peep hole opti mization and poor man partial evaluation for ex ample transforming al a0 0 into al a0 or some thing into something and so on These optimizations only try to increase the read ability of the Java code After these optimizations we get somewhat cleaner code such as this from a previous example public String format_lastchecked String s0 if BuiltIn empty lastc
12. programming languages they are more popular as intermediate languages for compilers and as machine independent executable program representations As in termediate languages may be listed e the ucsp p code used in the ucsp system an oper ating system well known for its Pascal compiler r code was either interpreted or compiled to native code We can find today p code compilers for more recent systems e the Smalltalk 80 bytecode is the intermediate lan guage of the Smalltalk 80 system Some other stack based languages target several machines as machine independent languages notably e the Java bytecode output from compiling a Java file It can be used on every system supported by Java because it will be interpreted by the Jvm Java Vir tual Machine Unfortunately computers are mainly register ma chines and it is not easy to implement directly and ef ficiently a stack based language That is another reason why stack based languages are not frequently used To day there are 3 ways to execute a stack based language on register machines via e an interpreter The execution is dynamic but very slow e a compiler that statically transforms the code into target one e a source to source translator to convert stack based code into a high level language that is then compiled for the target It allows the code to be executed on many different systems if the high level language is well known and widely used BST langua
13. 0 a Deepest element in the function Fic 7 Variable notations in Bistro stack pop getString System err println Warning a stack pop getString Fi else stack push year If a function with a stack is called by another function the latter will have a stack too Calls to any of the 37 built in functions of BiBIEX are translated to direct Java code when possible such as for or to calls to equivalent functions in the Brig TRX library For example the translation of this sst function FUNCTION format lastchecked lastchecked empty inbrackets cited lastchecked if will be without optimizations public String format_lastchecked String sO si int i0 sO lastchecked iO BuiltIn empty sO if i0 gt 0 sO else inbrackets sO cited si lastchecked sO s0 s1 return sO We can see the call to the empty function and the trans lation of the BsT concatenation operator to the Java concatenation The sst control flow operators if and while are replaced by their Java counterparts After these four passes we have a Java ast but this code is not optimized at all so we need to clarify it a lit tle Java optimization We decided to use several types of independent optimizations in order to provide a final optimization which is fully customizable by the user We do not need very complex
14. 8 1999 TUGboat Volume 24 2003 No 3 Proceedings of Euro TEX 2003
15. BTEX we are specially interested in the software architecture point of view since the project began first with the chal lenging idea of compiling the ssrt language into some thing newer and more expressive The principal elements of this architecture are closely related to the BislEX data flow and are summed up in figure 3 To be more generic and more scalable output is handled by prettyprinters of internal representations and input is read by parsers that build a common inter nal representation In this way we have only to define a new prettyprinter or parser to deal with a new format without having to change the BrBTEX internals The parsers are made with Sablecc 12 a compiler compiler for Java written in Java Unlike other compiler compilers such as Java Cup for example 14 we do not need a specific library to use the generated compiler So users only need Java to execute BiBIEX e The aux parser which tries to obtain the name of the style database filenames and information about languages used in the Tx file e The B1B parser which converts databases to a list of Java objects e The Bst parser which transforms a style file into a syntax tree e The pst compiler It takes this syntax tree and makes a Java style file from it It also tries to cor rect some common errors in BsT files and optimize the output code BreTpX core The core deals with all the basic Bis TEX infrastructure from bibliographical co
16. BisTEX Toward Higher order B sTEXing Fabien Dagnat Computer Science Lab ENST Bretagne CS 83818 F 29238 PLOUZAN CEDEX France Fabien Dagnat enst bretagne fr http perso info enst bretagne fr fdagnat index php Ronan Keryell Computer Science Lab ENST Bretagne CS 83818 F 29238 PLOUZANE CEDEX France rk enstb org http www lit enstb org keryell Youssef Aoun Laura Barrero Sastre Emmanuel Donin de Rosi re Nicolas Torneri Emmanuel DoninDeRosiere Nicolas Torneri enst bretagne fr Abstract In the ETEX world B s TFX is a very widely used tool dealing with bibliographies Unfortunately this tool has not evolved for the last 10 years and even if a few other bibliographical tools exist it seems interesting to develop a new tool with new features using modern programming standards The BisTgX project began in 1999 and is written in Java for the portability and object ori ented aspects and offers new functionalities for the expressiveness the security model and native Unicode character set support Bin TpX styles are directly Java classes for compatibility it uses advanced compiler techniques to translate plain old B s TEX styles to new Java styles Such a trans lated style can even set the development basis of a new native Bin TpX style to ease the style pro grammer s life The architecture is designed for extensibility and split into different components core parsers to be compatible with other bibliograph
17. Bistro compiler that currently generates Java code for a Java Bis xX library could be retargeted to other bibliographical tools such as Bibulus in Perl with its own library Another usage of Bistro is to ease the development of plain B B TEX files Since it can translate BsT code into cleaner Java code it can be seen as a reverse engineering tool for people more comfortable with Java than Bsr A code transformation framework for automatic lo calization of an existing BIB TFX style is still to be stud ied to understand the output from a given language to another one From a computer science point of view it is fasci nating to see how many interesting research questions are to be solved in a tool as simple at first glance as a bibli ographical management system But this must not move us away from the typography domain with some issues such as how to deal with complete mix of Latin Arabic Chinese entries in the same bibliography and so on Further information on Bis TEX with its code can be found at http bibtex enstb org Thanks The authors want to thank all the students that have worked with them during their studies on the BiBTEX project through various internships in the Computer Sci ence Laboratory at EnsTBr Laurent Corpivat Guil laume Ferrier and Emmanuel VaLLIET who pro grammed the first lines and the infrastructure with Nico las Tornert during their first year internship PAP 2P in 2000 Etienne De Benoist
18. EX we will have to create a more expressive style language But because of the need for compatiblity with BiBIEX we ll have to transform this stack based language into a stan dard one So we will see how to remove the stack in a stack based language Stack removing in stack based languages Anumber of techniques have been proposed in the literature for this type of translation Source to source translator There are only a few source to source translators for stack based language The most famous research on this was done in 10 11 where Forth code was translated into C in order to increase the portability of Forth applications Ideally to use a Forth application on a special system one should develop a spe cial interpreter However if one transforms the Forth into C first the program can be used on every system where a C compiler is available Furthermore no deep optimization of the translator is needed since the C com piler will optimize the output code Practically all the other source to source translators for stack based language are Java decompilers like kraka toa 24 or mocha 25 which try to transform Java byte code back into Java With this the idea is to get back the program sources from compiled files Nevertheless all these translators use the same algorithm and special Bis TEX Toward Higher order Bis IEXing C variables Stack DA S o Top of the stack Po N p Top of the stack p2 upon func
19. ams but only text with some simple ATX mark up tags On the other hand the key information being directly managed by Brg TFX and B B IFX can be dealt with by the plugin and output in the correct format Modifying the output of the bibliography style with a plugin is harder since one should access the type of the data For example if one wants to write a plugin to mod ify any existing style to display the dates in a numerical form instead of a textual one say by replacing via reg ular expression mechanisms all occurrences of Novem ber with 11 one needs to apply this translation pro cess only on the date field which we are not aware of And what would happen if an author is named Novem ber This kind of problem is similar to automatic trans lation of buggy pre year 2000 programs that cannot deal with years after 1999 to cleaner programs that can deal with them Automatic transformations must be applied only on code that certainly deals with dates and not other numerical computations An interesting approach could be to type the out put text with the data attribute used to build this text through B s TEX in order to approximate the data dependence graph with a slicing approach 26 that is to extract from the style code only the minimal code needed to generate the value of a given variable stati cally during the B B TEX compilation process or by stat ically analyzing the Java BiBTEX style In this
20. ats than TEX To avoid conflicts with other tools that could also use this kind of extensions a naming space beginning with bibtexpp is used For example if a user from the computer science community wants to directly use citations from the Cite Seer database 22 this will be chosen with bibliography bibtexpp plugin citeseer If a user wants to add a plugin style to automatically add the output of a url attribute if any from the database at the end of the typeset bibliography item the following will have to be added bibliographystyle bibtexpp plugin add attribute url or more generally to add the output of some specific at tributes description and summary bibliographystyle bibtexpp plugin add attribute list description summary or all the attributes with bibliographystyle bibtexpp plugin add attribute all Plugins themselves can be downloaded from the de fault BiBIEX network repository defined in its code with for example bibliographystyle bibtexpp plugin meta beautiful bib of from any other place by defining a urt such as bibliographystyle bibtexpp plugin meta URl http nice bib org beautiful bib If the BiBIEX installation is a little bit old some plugins may be absent from the local distribution but present in the Brn TEX Internet repository To be able to compile documents without choking BiBTEX can be used in an automatic metaplugin way where any lack ing plugin wi
21. ble with plain old B s T X BislEX is a free software program written in Java a clean portable object oriented language that na tively handles Unicode Since it is written in Java BiBlEX is ready to run on every Java enabled com puter although the installation phase is still to be stream lined B B TEX uses advanced compiler techniques in a compiler Bistro for recycling dusty deck Bsr and BIB files It translates a native B B TEX style written in the pst stack language to a new B B I X style written in Java that can be extended further as a basis of a class of new styles Right now B s TEX has been tested on Linux and Windows on all the B1B TFX styles found in the te TEX and MiK TREX distribution Indeed it allowed us to find that some of these styles are incorrect 3 This interesting idea could be realized in B1B TEX by writ ing a plugin 486 TUGboat Volume 24 2003 No 3 Proceedings of Euro TEX 2003 The plugin architecture is still to be developed in the current version with a general extension framework Other input front ends and output back ends are still to be written for tools other than BTEX such as OpenOffice and DocBook But once these plugins are written we can reach the great bibliographical unifica tion for example having a Word document with an xML bibliography database fetched from the Internet us ing a bst B1BTYX style for a journal found on the In ternet The
22. ch we turn to now Security model In a tool such as this where code can be downloaded by foreign documents automatically and transparently from alien servers security sounds a little scary It could be easy to design B s TFX viruses Hopefully BiBTEX is written in Java which im plements a sensible security model controlling in a cen tralized way the execution of arbitrary code 18 at a 484 TUGboat Volume 24 2003 No 3 Proceedings of Euro TEX 2003 very fine level We use this mechanism that has been tailored to al low secure execution of programs retrieved from the In ternet applets in web browsers in a similar way It is used in BiBTEX to avoid plugin code access ing sensitive local resources modifying the security in frastructure of B B TEX and other obvious concerns At installation the policy file contains grant permission java util PropertyPermission bib_max read write grant codeBase file bib_lib permission java io FilePermission lt lt ALL FILES gt gt read write execute permission java util PropertyPermission bib_cache read permission java util PropertyPermission bib_lib read permission java util PropertyPermission java class path read All classes except those inside the B B T X library thus plugins and styles can only access one environment variable bib_max It is the maximum length of a string in a style Performance results Wit
23. e tackles both extensibility and B B TEX compatibility Nevertheless some are closely related to our project such as MIB1B8 TEX and Bibulus MIB15TEX MIBis TEX 15 is a multilingual version of B BTEX rewritten in C The database files and behavior remain mostly compatible with B sT X with small ex tensions The cited article introduces in a well documented way the domain and issues related with bibliography in ternationalization and typography The main point of M1Brs TX is the introduction of language switches inside the bibliography items to be able to choose the most correct translation given by the author according to the current language such as different notes or different transliterations of an author name Some other fields such as the dates and so on are also naturally translated Some extensions are planned such as using Unicode and a localized sort but extensibility relies on adding fea tures in the code Bibulus Another tool tackles multilingual bibliographies with an extensible framework but without a BiBTEX compatibility for styles Bibulus 27 As with BislEX written in Java Bibulus is writ ten in a language that can deal natively with Unicode Perl This allows dealing with all the world s languages Since collators are also available sorting can be done ac cording to the requested language The input database format uses xML but a tool has been written to translate BIB T X s native bib
24. ed for human comprehension it Bis TEX Toward Higher order BisIEXing should be easier to modify an existing style as a develop ment basis of a new native BiBTEX style Furthermore because there are more Java pro grammers than BsT ones new arbitrary and complex styles will be easier to create with BiBTEX than with BiBIYX If a simple interpreter had been designed in stead of a translator this would not have been possible More information on the BsT to Java compilation can be found in 8 but 2 phases are detailed here Java translation First information about functions is searched for in the BST ast For each function we try to obtain the name of the function the number of in put and output parameters and the possibility of remov ing the stack in this function unfortunately this is not al ways possible Then the type of the arguments of all functions are inferred with type propagation from hints found in the program outside the stack such as typed constants a string or an integer typed global variables and use of BiBIYX functions with well known entry or return types The propagation is recursively done for all the home made functions Propagation is done in both di rections in a use def or def use way to deal with typed entries or output Some further abstractions are used to follow the dependency graph even if there are stack ma nipulation operations in the code such as duplicate pop or swap When it is n
25. faster exe cution is needed for Java applications Better Java per formance can be achieved by Just In Time jir com pilers which translate the stack based Jvm bytecode into register based machine code One crucial problem in Java j1T compilation is how to map and allocate stack entries and local variables into registers efficiently and quickly so as to improve the Java performance LaTTe 28 is a Java J1T compiler that performs fast and efficient register mapping and allocation for sparc machines LaTTe converts Java bytecode a stack based language to sparc assembler It uses severals steps for this e first LaTTe identifies all control join points and subroutines in the Java bytecode via a depth first traversal in order to build a control flow graph cFG e then it converts this bytecode into a crc of pseudo SPARC instructions with symbolic registers e optionally some traditional optimizations are per formed e in the fourth step LaTTe performs a fast register allocation generating a crc of real sparc instruc tions e finally the graph is converted into a list of sparc in structions To transform the stack into registers LaTTe uses symbolic pseudo sparc registers whose names are com posed of three parts e the first character indicates the type a for an ad dress or object reference i for an integer f for a float 1 for a long and d for a double e the second character indicates the location s for ope
26. ge A style file for BIB TFX is a program that formats the reference list ina certain way For exam ple a style file can sort the reference list in alphabetical order using the author names and italicize titles The ssr language 23 is a domain specific language using ten commands to manipulate language objects con stants variables functions the stack and the entry refer ence list A string constant is between double quotes like abcd efgh and an integer constant is preceded by an like 23 There are also three different types of vari ables e global variables declared by INTEGERS or STRINGS commands e entry variables which can be strings or integers with a value assigned for each entry of the list e fields which are read only strings They represent information from the curent reference item so each one has a value for every entry Among the 10 BsT commands available here are some of the more interesting ones e ENTRY declares the fields in the bibliography data bases and the entry variables crossref is a field which is automatically declared used for cross ref erencing and sort key is an entry variable used for sorting references also automatically declared e ITERATE executes a single function for each entry in the reference list These calls are made in the list s current order e READ reads the database file and assigns to fields their value for each entry e REVERSE performs the same action a
27. guage to any other we need to write 1 translators which is cumbersome Instead if we intro duce a kind of esperanto intermediate abstract repre sentation we only need to write translators to this inter mediate form and then prettyprinters to each language Another way for classical BsT crude code translation would be to use pattern matching to translate common piece of code Of course since no semantics recognition can be used this method is not very adaptable Code transformation It is interesting to have a code transformation engine in B18TEX to allow plugins to modify the behavior of other styles and implement other features Transformations could be done at different levels in BiBIEX on the ssrt internal representation or the Java BiBTEX style more generally or more conserva tively on the input data structures The code transformation itself could use the hook mechanisms already present in the code or an aspect pro gramming tier in the BiBTEX infrastructure A low level approach could be to allow plugins to modify the code for example adding at the end of the output rou tine a call to a new procedure that will output a new field by using Java reflection and introspection Of course from the security point of view this should be very carefully controlled to avoid plugin mal ware rewriting security checking in B s TEX But this can also be enforced by the underlying Java security model whi
28. h allows the creation of arbitrary control struc tures it is easiest to convert them into C goto instruc tions and labels This translation mechanism must know the height of the stack everywhere in the Forth code but it is not always possible Sometimes the stack depth is unknown For example the instruction 7DUP O IF means that if the top of the stack is 0 replace it with the previous ele ment on the stack else we delete the element So in this TUGboat Volume 24 2003 No 3 Proceedings of Euro TFX 2003 479 Fabien Dagnat Ronan Keryell and Youssef Aoun Laura Barrero Sastre Emmanuel Donin de Rosi re Nicolas Torneri case f2 has to create a stack in C and use it throughout the whole function Compiler Source to source translators are not the only software which remove the stack in a stack based language Stack based compilers do the same thing but they convert this language into a low level one often into mnemonic instructions So their algorithms may be use ful for Bis TEX RAFTS 10 is a framework for compiling Forth code It tries to produce fast and efficient code so it needs to use some optimization techniques and interpro cedural register allocation to eliminate nearly all stack ac cesses because they slow down the execution of the pro gram RAFTS compiles all of Forth including unknown stack heights RAFTS uses several steps to compile Forth code The first step is to split the code into basic blocks
29. h the power of modern comput ers compared with the older computers at the beginning of BiBIEX we may think that compiling a bibliography must be quite fast and not significant in the composing time But although the original B BsT X is quite simple and fast B s TEX is noticeably more complex with its compiler engine and various optimization phases One could ask if it is still fast enough Some tests were made on a Athlon xP 2000 pc with 512 mB of RAM with 2re Java 2 Runtime Envi ronment version 1 4 1 for Linux The B Bs TE X pro grams were compiled by the Sun javac with the 0 op tion to optimize the code Besides the performance evaluation the compati bility of Bistro with BIB TFX styles has been investigated by compiling all 152 styles in the MiK TEX distribution This allowed us to find and correct some bugs in our soft ware as well as some bugs in old B s TFX styles The execution time and the size of the styles be tween the optimized version of Bistro and B1B I X and the normal one is compared in figure 8 We can see with the Bistro execution time that it is two times slower to generate optimized Java style file than non optimized one Nevertheless the compilation of a bst style file to a Java class file remains quite fast by considering the B B TEX Toward Higher order Bis EXing Seconds 400 375 300 200 100 0 BiSTrO execution javac compilation Without the 0 option 1bliogra
30. hecked gt O 482 TUGboat Volume 24 2003 No 3 Proceedings of Euro TEX 2003 sO else inbrackets sO cited lastchecked return sO If we look at another function from plain bst FUNCTION new sentence output state after block gt skip output state before all gt skip after sentence output state if if This is translated to rather long Java code public void new_sentence int iO il i0 output_state ii after_block iO BuiltIn equal ii iO if i0 gt 0 ag else i0 output_state ii before_all iO BuiltIn equal ii iO if i0 gt 0 else iO after_sentence output_state i0 but the optimizations downsize it to a more understand able function public void new_sentence if output_state after_block if output_state before_all B B TEX Toward Higher order B1B T Xing output_state after_sentence We can see in this example many different optimizations at work e all empty hex blocks have been removed e all global variables have been propagated the code i0 after_sentence output_state i0 has been transformed into output_state after_sentence We no longer use any local variables e some built in functions have been converted to bool ean operators the BuiltIn equal i1 i0 gt O isnowasimple i1 gt i0 So we can see
31. here that all these transformations are pretty efficient Indeed the optimized function is much more readable that the non optimized one Plugins and meta plugins Plugins architecture The strategy pattern used is based on hook mechanisms such as that used in the Emacs editor In the original design many hook points are cho sen to enable users to insert calls to their own functions From a software engineering point of view it is close to aspect programming but in a restrictive way since all the points that can be modified are defined in advance We think this approach is more tractable but if some features are not easy to implement with the exist ing hooks more can be added since BrBTEX is also an evolving open source program Lots of hook objects can be used to replace objects in the current architecture thus modifying the global be havior as in the following examples Some other specialization frameworks remain to be studied further in this context to fit future exten sions such as direct subclassing of Bin TEX classes as pect programming and reflection and introspection on B B T X classes The main issue is that code complex ity remains manageable and security is not endangered Parsers The management of the various inputs is dealt with by parsers crafted to each input format They rely heavily on the Sablecc parser generator 12 to speed up retargeting of B s TEX to a new data format New parsers can be l
32. ical styles sources or encoding schemes pretty printers to generate bibliographies for other tools than 4X plugins The plugin con cept is used to dynamically extend Bi8TEX functionalities For example since meta plugins can load new plugins new styles can be directly downloaded from the Internet R sum Dans le monde BIEX BrsTEX est un outil r pandu pour g rer les notices bibliographiques Mal heureusement cet outil n a pas volu ces dix derni res ann es M me si d autres outils bibliogra phiques existent il semble int ressant de d velopper un nouvel outil offrant de nouvelles fonction nalit s et utilisant de nouveaux standards de programmation Le projet Bis TEX a d marr en 1999 et il est crit en Java pour des raisons de portabilit et de fonctionnalit s accrues dues aux aspects de programmation orient e objet Il offre de nou velles fonctionnalit s B1BTEX est une classe Java pour son expressivit le mod le de s curit et le support natif d Unicode il contient un compilateur pour traduire les anciens styles Big TEX en Java et ce code Java peut tre la base d un style bibliographique B1BTEX natif de ma ni re faciliter la vie du programmeur l architecture a t con ue en vue de l extensibilit le noyau les parseurs pour tre compatible avec d autres styles bibliographiques d autres sources ou codages les enjoliveurs de code pour g n rer des bibliographie
33. ll be retrieved from the repository If other plugins have been registered on the naming global B s TFX directory but reside on other servers a proxy plugin will be downloaded to download later the real plugin code from its server Naming clashes should be avoided either with the current TEX best practice for package names or by using a hierarchical naming space mimicking Java class naming space or URL names Indeed a plugin call can be defined equally well in either the bibliography or bibliographystyle macros but according to the plugin role one may be more logical than the other The basic compatibility with ATX and B s TEX is based on the fact that some macros with this syntax will only generate warning in B s TEX without stopping the BTFX compilation Of course the bibliography of the document will be lacking or at least incorrect a user without BiBTEX will be able to have an approximation of the document More expressiveness can be used with new macros defined in a new package bibtexpp if this compatibility is not mandatory Of course a parser plugin can itself define a new plugin definition or parameter syntax to deal with other 476 TUGboat Volume 24 2003 No 3 Proceedings of Euro TEX 2003 Bis TEX Toward Higher order Bis IEXing Fic 3 Bis TEX work flow input languages such as with DocBook or Word doc uments Software architecture of Bi TEX Overview of the BisTEX architecture In Bi
34. n old one with at least the bibliographi cal references that are used in the article being produced with BIEX Each reference record has a type chosen from the 13 possible default types article book con ference thesis and is composed from various fields such as its key used to cite this reference from the BTEX file its title its author s the publication year and so on such as BOOK LaTeX companion Author Michel Goossens and Frank Mittelbach and Alexander Samarin Publisher Addison Wesley Title The LaTeX Companion Year 1994 This reference describes a book and can be cited with the key LaTeX companion If there are several authors they are separated by an and Plain IXTEX can often be put in most of the fields such as the LaTeX in the pre vious Title There are numerous kinds of fields 23 available to be used to define a reference According to the reference type a field can be mandatory or optional Other fields can be used for extensions or information since they will be ignored by BrB TX itself Once the reference file is created the reference must be inserted in the BIFX document For this pur pose a cite fey command is put where a reference to key is to be cited Thus with the previous example inserting in the text cite LaTeX companion will appear as 13 One instructs TEX to use a bibliography sty e with bibliographystylef sty e and to insert the bibli
35. ncepts to house keeping and the data structures used by various abstract internal representations All the B B TEX functionalities that can be used by the various bibliographical style are implemented in a core library Bibliography back end This relatively simple part outputs the internal style execution into a file usable by the typesetting tool to be used Right now a bb1 file to be used by TFX is generated but by changing this prettyprinter other output could be generated for an other tool Document front end It is organized according to a strategy pattern to be able to deal with various document formats Right now a Sablecc parser has been written to deal with TEX only Bibliographical database front end This front end also follows a strategy pattern to cope with various data base formats A Sablecc parser has been written now to read only BiB8IYX bibliographical database in the bib format Caching BreTgX styles BisTEX styles can be stored on the computer running it as with B1B TEX but can also be retrieved from the network or translated from an old BiBIYX Bsr style If the first access method is quite fast the two other ways may be deadly slow compared to it This is why a cache architecture has been added in the BiBTEX style pipe to avoid fetching again and again a remote BiBlEX style or translating a style from BrB TFX for mat on every BiBIEX run Software architecture of the Bistro pst to Java compiler
36. nd extensions for example by using an object oriented language But we also want compatibility with the old B1B8TYX styles that are written in BsT so this is rather tricky Besides B s TFX targets only BIFX Bis TEX could also target other typesetting tools or other bibli ographical database concepts But since BiBTEX is still a work in progress as a general bibliographical workbench there are many new functionalities that are not yet implemented or even not envisioned yet Style programming in B1sTEX If we have to define a new language for BiBTEX it should be a clearer lan guage than BsT A good candidate is to choose a domain specific lan guage psc From a programmer point of view it is yet another less cryptic language to learn that is still cumbersome The expressiveness may not suit everyone s needs and we may extend the language later to fit some usages On the other side if we want a language as expres sive as any another computer language why not use such a language If we choose an object oriented language all the domain specific aspects could be seamlessly hidden in objects dealing with all the bibliographical stuff Since in B s T X there is no particular perfor mance requirement this solution is acceptable The next question is to select an implementation language We want BiBlEX to be portable pro grammed in a clean language from a syntax and object point of view that can deal with big pr
37. o BibTEX Diplome d tude appro fondie ENSTBr September 2003 http waw lit enstb org keryell eleves ENSTBr 2002 2003 DEA Donin_de_Rosiere 9 Emmanuel Donin de Rosi re tat de Part sur les logiciels de gestion de r f rences bibli ographiques compatibles avec BIFX et sur la suppression de la pile dans les langages pile tude bibliographique de dipl me d tude ap profondie ENSTBr September 2003 http waw lit enstb org keryell eleves ENSTBr 2002 2003 EB Donin_de_Rosiere 10 M Anton Ertl A new approach to Forth native code generation In EuroForth g2 pages 73 78 1992 11 M Anton Ertl Implementation of Stack Based Lan guages on Register Machines PhD thesis Techni sche Universit t Wien 1996 12 tienne Gagnon SableCC an object oriented com piler framework PhD thesis School of Computer Science McGill University Montreal 1998 13 Michel Goossens Frank Mittelbach and Alexan der Samarin The TEX Companion Addison Wesley 1994 14 Scott E Hudson CUP Users Manual Georgia Institute of Technology March 1996 15 Jean Michel Hufen European Bibliography Styles and MIBibTEX In EuroTgX 2003 this vol ume ENST Bretagne France June 2003 16 Inmos The Transputer Databook 1989 TU Gboat Volume 24 2003 No 3 Proceedings of Euro TEX 2003 487 Fabien Dagnat Ronan Keryell and Youssef Aoun Laura Barrero Sastre Emmanuel Donin de Rosi re Nicolas Torneri
38. oaded as plugins in BiBTEX when requested by the user Prettyprinters Writing plugins to output new bib database files does not cause any trouble since it is a sim ple prettyprinter that outputs the internal database rep resentation But automatically translating the Bis TEX output into another language or targeting a new typesetting sys tem is far more challenging Basically BiBTEX is a tool able to run BiBTEX native code or BiBTYX code in TUGboat Volume 24 2003 No 3 Proceedings of Euro TFX 2003 483 Fabien Dagnat Ronan Keryell and Youssef Aoun Laura Barrero Sastre Emmanuel Donin de Rosi re Nicolas Torneri an improved way but is not able to abstract the seman tics of what a piece of BiBIEX code itself really does of course in fact this is an intractable issue from theoret ical computer science B1B I X has no idea that it is outputting an author name or a conference name it is ex ecuting a Java procedure with a side effect that outputs a string Thus we can only rely on some heuristics to deal with the prettyprinter parameterization such as recog nizing a bib text output and translating it Since it is not possible to understand the BiBTEX style it is not possible to modify it for retargeting the I4T EX output to another typesetting format Instead one can translate the TEX output item to another format This is simple to do since generally bibliography styles do not generate complex TEX progr
39. ograms The lan guage should come with a lot of standard libraries to deal with all the modern programming ways Unicode Inter net and widespread enough to avoid the yet another weird language to learn syndrome Of course there is no one stop answer and we cannot escape some trade offs From our point of view Java has been considered as a good candidate The BiBlEX core is thus directly written in Java for expressiveness and simplicity All the generic li brary functions and classes to deal with bibliographies in B B TEX have been rewritten in Java too Bra TpX can run on every machine for which we have a run time and a compiler For internationalization Unicode is natively ac cepted in Java we inherit all the Java locale stuff and Bra lEX Toward Higher order Bis EXing even specialized collators for international sorting so im portant in Bip px Of course choosing a language different than the original pst language does not solve at all the B1B TEX compatibility issue This one can be solved by im plementing BrB TFX as an add on in B s T X which would remove a lot of interest in BiBIEX or add a translation process from BsT to the new programming style in BiBIEX This last approach is more challenging but far more interesting since the translated old Bsr styles can be used as the basis of new style developments This translation process is more deeply described in Software architec ture of
40. ography somewhere in the document from the data base 0b base bib with a bibliography ib base When run BiB TEX picks in the document aux file the needed information given by the citation marks placed in the ITEX document document tex file by the author A ready to typeset version of the bibliogra phy is made by BiB8TYX to the document bb1 file by us ing a style bst bibliography style file and the citation matter found in the bib file s Error and information output goes to the document blg file The work flow is summed up in figure 1 13 B B TFX comes with some predefined styles but it is also possible to program other styles for example to accept a url field to cite Internet information All these styles are defined in bst files that are used by B s TEX FUNCTION sort format names s 1 nameptr s num names numnames numnames namesleft namesleft 0 gt nameptr 1 gt 0 mx gt skip if s nameptr vv H11 FHL fff FHL jji p format name t nameptr numnames t others and et al t sortify if nameptr 1 nameptr namesleft 1 namesleft while Fic 2 BsT sample code to generate the bibliography according to the work flow described in figure 1 From the user point of view these concepts are also used in BiBTEX zexto with all the old BisT xX styles available too The style files are written in the
41. or typographers if the article talks about Larousse 2002 as a book introducing meta middleware 20 and in the bibliography Larousse 2002 is described instead as a French cookbook there has clearly been a problem somewhere Another prob lem is that each journal has its own bibliography style so bibliographical management software has to allow the user to create his own style and send it to other people Fortunately B1B TEX 23 is a popular tool used by the BIEX 21 community to generate bibliographical notices in publications If there are also many other tools available 9 this one suits very well the TEX philos ophy and is well integrated with it the user describes what she wants with a mark up language without having to dive into the deep layout details the ATX infrastruc ture will use some styles to typeset the presentation from the high level content description The citation matter is stored in a database a file with a bib extension and BiBIEX picks from the aux file the needed information according to the citation marks placed in the XTEX document tex file by the author A typeset version of the bibliography is made by B B TFX to the bb1 file by using a bst bibliography style file The work flow is summed up in figure 1 13 There are a lot of bibliographical styles available for B s TFX targeted at many different scientific journals book styles etc The user needs only to select the de sired
42. ot possible to infer the type it indicates that we will have to use a polymorphic Ce object which can store either a string or an integer Next the body of the functions and their stacks are analyzed to determine how many Java local variables we will have to use and their types With all this information the Bst code is translated to Java functions where we can remove the stack by us ing local variables instead of stack items when possible or generate Java functions with a Java stack when stack removal is not possible Variables are named accordingly to figure 7 If the type has been inferred the native Java types String or int are used instead of our polymorphic type Cell If stack removal is not possible in a given function the stack architecture is kept but with a Java api The generated code looks like this public void format_bdate stack push year stack push BuiltIn empty stack pop getString if stack pop getInt gt 0 stack push there s no year in stack push BuiltIn cite bib stack push stack pop getString TUGboat Volume 24 2003 No 3 Proceedings of Euro TEX 2003 481 Fabien Dagnat Ronan Keryell and Youssef Aoun Laura Barrero Sastre Emmanuel Donin de Rosi re Nicolas Torneri JAVA local variables Stack c5 i s5 ne c4 i4 s4 Top of the stack c3 i3 s3 Number of input c2 i2 s2 Top of the stack pa amieters cllillsi upon function entry c0 i0 s
43. phy creation With the 0 option Fic 8 Total execution time of the BiBTEX components on 152 styles a6 ko 70 60 50 40 30 20 10 0 java file class file bst file Non optimized file Optimized file Fic g Mean size of some style formats BisTro execution time plus the javac execution time to generate the class file only 3 2 seconds on average per bst file without any optimization and 4 4 seconds with all the optimizations Furthermore since we use a cache mechanism to compile a new sgsr file to Java only once this compilation time is spent only the first time we use a BST style all subsequent executions of B1BTEX with the old B s TFX style will skip the compilation phase and thus run faster The execution of Bis TEX is far slower than the original B s TFX that runs in about 0 04 second on a small example but this is not disturbing for a normal user because he just has to compile the bst file once the 3 2 seconds above and next time the creation of the bb1 file will only take 0 8 second Finally the optimizations are not very useful for a standard BiBTEX user it increases the compilation time but does not decrease the execution time Nevertheless they are useful for style designers In deed we have already seen that there are two ways of cre ating a new style by modifying an existing one or by cre ating a new one from scratch For both it is easier with BiBTEX than with B B
44. rand stack 1 for local variable and t for tempo rary variables used by LaTTe e the remaining number distinguishes the symbolic registers For example i12 represents the second local integer reg ister At the end of the algorithm LaTTe transforms these pseudo registers into real ones with two passes for each extended basic block e the backward sweep algorithm is a post order tra versal which collects information on the preferred destination registers for instructions e the forward sweep algorithm is a depth first traver sal which performs the real register allocation using that information Sometimes we need to move some registers in order to reconcile register allocation at region join points because LaTTe uses these two algorithms on each extended basic block independently So two blocks may not use the same register for the same item on the stack Globally this method is very efficient the output code of LaTTe is on average two times faster than the Sun JIT and this speed comes particularly from the reg ister allocation algorithm Compiling BisTeX Bsr styles to BreTRX Java styles The transformation of a typeless stack based lan guage into an object based one is something quite un usual and a bit complex We planned a classical com piler architecture divided into several steps as shown in figure 6 480 TUGboat Volume 24 2003 No 3 Proceedings of Euro TEX 2003 bst AST JAVA AST JAVA vi timized AST
45. s ITERATE but in reverse order e SORT sorts the reference list in alphabetical order according to sort key 2 There is probably no other popular architecture since the Transputer 16 478 TUGboat Volume 24 2003 No 3 Proceedings of Euro TFX 2003 All these commands support defining the structure of a style file But with them we can not manipulate variables This is why 37 built in functions have been declared in B s TFX from integer and string computa tions to control flow operation if while and the write which writes the top string item into the bb1 file the B s TFX output With all these built in functions and commands some other new useful and more complex functions can be designed such as FUNCTION and skip pop 0 if This function calculates the logical and between two numbers if the first element on the stack is greater than o meaning true skip is executed so this function returns the second element on the stack Else pop 0 is executed which puts o on the stack We can see that even with this over simplified example it is not very easy to understand the ssr language e we are not accustomed to postfix stack notation e the number and the type of input and output vari ables are implicit e we have to read all the control structure in reverse order This explains why only a few people are able to pro gram a new style in this language So for BiBT
46. s pour d autres outils que IXTEX les plug ins le concept de plug in est utilis pour tendre B s TEX de mani re dynamique Ainsi puisque les meta plug ins peut leur tour charger d autres plug ins des nouveaux styles peuvent tre t l charg s sur Internet Introduction by literal quotation or indirectly through paraphrase or where you have used information or reproduced ma A bibliography or list of references is a listing of all enal These tefrences RE sources from which you have taken information directly 472 TUGboat Volume 24 2003 No 3 Proceedings of Euro TEX 2003 e clearly identify each document So it provides some identification elements to allow the reader to look for these documents in library catalogues or any where else In most cases these identification el ements are normalized 17 we often use the name of the book the author the editor but be cause of the digital revolution there are more and more document types web pages for example and identification elements e mail uRL So the management of the references has become more and more difficult enable the reader to consult the sources you have used with a minimum of effort Thus we have to indicate precisely where on which page the elec tronic location or under which circumstances per sonal interview e mail you obtained the informa tion Unfortunately creating a bibliography has always been a headache f
47. ssr language This is indeed an awful stack based language rooted in the sixties that was chosen for an easy implementation of BrsIX concepts it is simple to parse and to execute on a computer The dark side is that the programming bur den is put afterwards on the style programmer BsT code looks like that in figure 2 and there are 1258 such lines in the classical alpha bst It is clear that building a new style from scratch is a tour de force and often basic programmers will change only few details Fortunately there are many styles avail able already that can fit most needs and there are also some custom style generators 5 Extensions to BreTpX A basic extension is to be able to deal with encodings other than plain asc11 and more gen erally to be multilingual Since BiBIEX can sort the bib liography a localized sort according to the document lan guage is to be introduced 1 According to its author this language has no name in fact But for the clearness of this article we call it sst 474 TUGboat Volume 24 2003 No 3 Proceedings of Euro TEX 2003 A tool designed today could hardly escape the net worked world so BiBTEX must have a way to access world wide on line bibliographical databases through the Internet The ssr language in BIs TEX lacks some expres siveness and a new language should be designed instead of trying to extend the old one Some modern features should be added to allow scalability a
48. style and the bibliography notice is generated from her common bibliographical reference database There are also a lot of such bibliographical reference databases available on the Internet that can be used directly such as 22 There are many tools targeted at easing the man agement of all these BIs TFX files database tools edi tors For example to write this article we used the grand Emacs multi platform text editor that has various B B TEX Toward Higher order Bis IEXing Fic 1 BiBTEX work flow modes to deal with a ITEX document in various cod ing systems the great auc TEX mode 1 to deal with many things in the XTRX source file ref TFX 7 to deal with citations and cross referencing such as a bibliogra phy browse and pick mode and some B B TEX editing modes A lot of B B TEX record databases are also widely available on the Internet through bibliographical servers such as CiteSeer 22 and it is often easy to get some Bi8TEX records from few keywords Even though there is so much material available for B B TFX B B TFX is old does not evolve anymore and has many shortcomings according to modern tool standards the character encoding is constrained to an 8 bit asci variant it is difficult to mix different languages on the database side or on the document side memory usage is selected at compile time style programming is done in a language that is rather optimized for the implementa tion efficiency and
49. the BisTro BsT to Java compiler Extending BisTeX further plug ins and meta plug ins Extensions in the old B B TEX to deal with new concepts are quite difficult to develop since code must be added directly in the B s TFX source In a modern tool it is mandatory to use a more in cremental and tractable approach even for an inexperi enced user by allowing loadable add ons or plugins in stead of needing to dig into the code to change its behav ior A plugin is a piece of code a module that can be added to B s TEX to increase its functionality without having to change the native BrBTEX infrastructure Plugins should be able to modify any BrsTpX be havior without corrupting the original design Of course there is compromise to be found between expressiveness and complexity We present further the kind of extension one can ex pect with the plugin concept applied to different parts of BiBIEX described later in Overview of the BislEX architecture Parsers A natural extension needs to regard the in put syntax that BiBTEX can accept New parsers can be written and used to change any information source into some internal abstract representations of the tool The bibliographical source could be changed to di rectly use the CiteSeer database 22 through the Inter net use some XML database or any other bibliographical database tool instead or in addition to the old bib syn tax database The input selection
50. tion entry Fic 5 Stack mapping to C variables optimizations for Java and jvm Java Virtual Machine bytecode In 11 the f2 Forth to C translator described uses several steps to convert Forth code to C language The first is to split the code into its functions which will be processed independently Then f2 counts the number of input and output parameters for each function The next step is to convert the elements on the stack into C s local variables as shown in figure 5 In that figure po P1 represent the entry vari ables of each function and o 1 are used like local variables This scheme ensures that stack items that are not affected by an operation do not have to be copied around between local variables Then f2 converts each Forth primitive into a C se quence For example if the top of the stack resides in 21 the translation of will look like Cell ni x1 Cell n2 x0 Cell n n ni n2 x0 n top of the stack now x0 This sequence is very long but a good C compiler can compile it to only one instruction sometimes it can con vert several sequences into one instruction So the trans lation process always works like this e all the useful elements are declared as C local vari ables and are initialized e the C code for the Forth primitive is generated e the result variables are copied back to the stack _f2c has also to convert all the control structures Since Fort
51. way it could be easy to determine that a given part of the text is a textual representation of the year the author names or the title and use this information to translate these texts in a representation without bibitem and so on suitable for other typesetting tools The typeset output for BT px could thus be retargeted easily since we would now have in the output what is an author name what is a surname what is a conference title etc Since we only want to know what input fields are in volved on a given output field we can use dynamic de pendence graph reconstruction Since B s TEX is pro grammed in an object oriented language overloading of the data type class to embed this on the fly dependence graph construction could be easy At the B s TEX out put procedure for each character the input fields used to compute its value is known This is similar for example to the tainting concept of variables used in the Perl language for security reasons to know if a variable value has been computed by using a value given by the user or not If yes and that variable is used to execute a privileged operation the program mer may refuse to execute such a dangerous thing by us ing tainted mode The automatic internationalization process uses the same approach to translate the output text from one lan guage to another But if we have existing bibliography styles say for l languages and we want to be able to trans late every lan

Download Pdf Manuals

image

Related Search

Related Contents

GeoNetwork User Manual  Kenwood BL450 series Blender User Manual  Einbau - Gebr. Kemper GmbH + Co. KG  Brochure Tapparelle instabus EIB  Intellinet PCI 10/100 LP  programme journée élevage chien + mde  Frigidaire 24 in. FDB750RCC Stainless Steel Built  Samsung Galaxy Note 2014 Edition (10.1) Uživatelská přiručka(Jellybean)    EWRC550LX  

Copyright © All rights reserved.
Failed to retrieve file