DE19622365A1 - Translator for transmitting source code for high level language, e.g. C, C++, Java, Fortran - Google Patents

Translator for transmitting source code for high level language, e.g. C, C++, Java, Fortran

Info

Publication number
DE19622365A1
DE19622365A1 DE19622365A DE19622365A DE19622365A1 DE 19622365 A1 DE19622365 A1 DE 19622365A1 DE 19622365 A DE19622365 A DE 19622365A DE 19622365 A DE19622365 A DE 19622365A DE 19622365 A1 DE19622365 A1 DE 19622365A1
Authority
DE
Germany
Prior art keywords
bit
bit sequences
assigned
symbols
length
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
DE19622365A
Other languages
German (de)
Other versions
DE19622365B4 (en
Inventor
Angelika Dr Knoll
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Deutsche Telekom AG
Original Assignee
Deutsche Telekom AG
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Deutsche Telekom AG filed Critical Deutsche Telekom AG
Priority to DE19622365A priority Critical patent/DE19622365B4/en
Publication of DE19622365A1 publication Critical patent/DE19622365A1/en
Application granted granted Critical
Publication of DE19622365B4 publication Critical patent/DE19622365B4/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/425Lexical analysis
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction

Abstract

The device translates the source code into a bit stream for transmission. The receiver reconstruction end provides a syntactical and logic equivalent program code. An abstract tree generated by syntax analysis is encoded in a bit efficient manner. The translator set bit streams are allocated to reserved or special spoken words. Short bit streams are allocated to the symbols by lexical analysis. On the basis of the analysis even constants are translated into bit streams. Instructions, e.g. a declaration, a function call up, arithmetic instructions and key words are allocated to short bit streams. The structure of a partial tree is provided if this structure is not unequivocally set to the key word. The key words and bit streams are combined in an unambiguous manner. For symbols which must be recognised externally the allocation of the symbol is transmitted to the internally used bit streams.

Description

Die Erfindung betrifft einen Umsetzer zur Übertragung von Quellencode nach dem Oberbegriff des Patentanspruchs 1.The invention relates to a converter for the transmission of Source code according to the preamble of claim 1.

Umsetzer von Programmcode in einen Bitstrom für die Übertragung sind grundsätzlich bekannt. Zum Beispiel muß bei dem in der ISO/IEC Expertengruppe MPEG in der Entwicklung befindlichen Standard MPEG-4 Quellencode bzw. Programmcode mit übertragen werden, um auf Empfängerseite den Decoder zu erzeugen. Auch in anderen Bereichen, in denen Programmcode übertragen werden muß und eine transparente Übertragung nicht erforderlich ist, das heißt der übertragene Code vor der Nutzung im Decoder compiliert werden muß und keine weitere Bearbeitung des Codes auf Empfängerseite stattfindet, kann ein solcher Umsetzer benutzt werden.Converter of program code into a bit stream for the Transfer are generally known. For example, must at the in the ISO / IEC expert group MPEG in the Development of the standard MPEG-4 source code or Program code to be transmitted to the recipient to generate the decoder. Also in other areas, in which program code must be transmitted and a transparent transmission is not required, that is the transmitted code compiles in the decoder before use and no further processing of the code Such a converter can take place at the receiving end to be used.

Die bekannten Umsetzer von Programmcode in einen Bitstrom für die Übertragung haben jedoch den Nachteil, daß sie nicht biteffizient sind.The known converters of program code into a bit stream for the transmission, however, have the disadvantage that they are not bit efficient.

Der Erfindung liegt deshalb die Aufgabe zugrunde, einen Umsetzer zur Übertragung von Quellencode dahingehend zu verbessern, daß ein Quellenprogramm, daß in einer Hochsprache geschrieben ist, so in eine Bitfolge umgesetzt wird, daß zum einen eine möglichst geringe Bitmenge erforderlich ist und zum anderen nach einer Übertragung ein syntaktisch und logisch gleichwertiger Programmcode entsteht.The invention is therefore based on the object Converter for the transmission of source code to that effect improve that a source program that in a High-level language is written, converted into a bit sequence on the one hand, the smallest possible bit quantity is required and secondly after a transfer Syntactically and logically equivalent program code arises.

Die erfindungsgemäße Lösung ist im kennzeichnenden Teil des Patentanspruchs 1 charakterisiert. The solution according to the invention is in the characterizing part of Characterized claim 1.  

Weitere Merkmale bzw. Ausgestaltungen ergeben sich aus den an den Patentanspruch 1 anschließenden Patentansprüchen.Further features and configurations result from the claims subsequent to claim 1.

Durch diese Maßnahmen wird ein direkter biteffizienter Umsetzer von Programmcode in einen Bitstrom für die Übertragung geschaffen. Die empfängerseitige Rekonstruktion liefert einen syntaktisch und logisch gleichwertigen Programmcode.These measures make it more direct bit efficient Converter of program code into a bit stream for the Transmission created. Reconstruction on the receiver side provides a syntactically and logically equivalent Program code.

Dazu wird der von der Syntaxanalyse erzeugte abstrakte Baum in biteffizienter Weise codiert, wobei den reservierten Sprachworten, aber auch den Sonderzeichen und Operatoren feste Bitfolgen zugeordnet werden, die wesentlich weniger Bits benötigen als die direkte Darstellung der reservierten Sprachworte und Operatoren/Sonderzeichen im Rechner. Dabei können häufiger vorkommenden Kombinationen eigene Bitfolgen zugeordnet werden.To do this, the abstract tree generated by the syntax analysis encoded in a bit-efficient manner, with the reserved Language words, but also the special characters and operators fixed bit sequences are assigned, which are much less Bits need as the direct representation of the reserved Language words and operators / special characters in the computer. Here combinations that occur more frequently can have their own bit sequences be assigned.

Besteht ein Programm aus mehreren Modulen, so werden den Funktionsnamen, Klassennamen und Methodenamen ebenfalls kurze Bitfolgen zugeordnet; die Länge der Bitfolge hängt von der Anzahl der Namen ab. Soweit diese Originalnamen beim Empfänger bekannt sein müssen, weil zum Beispiel nicht das gesamte Paket übertragen wird, muß diese Tabelle mit übertragen werden. Andernfalls ist dies nicht erforderlich, den entsprechenden Bitfolgen können neue Namen zugeordnet werden. Sind die Originalnamen beim Empfänger bereits bekannt und die entsprechenden Module bereits vorhanden, so ist diese Tabelle ebenfalls erforderlich.If a program consists of several modules, the Function names, class names and method names as well short bit sequences assigned; the length of the bit string depends depends on the number of names. So much for these original names must be known to the recipient, for example not the entire packet is transmitted, this table must be included be transmitted. Otherwise, this is not necessary new names can be assigned to the corresponding bit sequences will. Are the original names already at the recipient known and the corresponding modules already exist, see above this table is also required.

Bei den globalen Variablen, Strukturen und Instanzen werden ähnliche Prinzipien angewandt. Auch hier sind die Originalnamen beim Empfänger meist nicht erforderlich, so daß auf die Übertragung einer Zuordnung von Originalnamen zu Bitfolgen verzichtet werden kann. Ansonsten muß diese Zuordnung in Tabellenform übertragen werden, zumindest für diejenigen Originalnamen, deren Kenntnis im Empfänger erforderlich ist.The global variables, structures and instances similar principles applied. They are here too Original names are usually not required for the recipient, see above that on the transfer of an assignment of original names bit sequences can be dispensed with. Otherwise, this must Assignment are transferred in tabular form, at least for  those original names whose knowledge is in the recipient is required.

Bei lokalen Variablen, Strukturen und Instanzen ist die Übertragung der Zuordnung nicht erforderlich, beim Empfänger können andere Namen gewählt werden.For local variables, structures and instances, this is Transfer of assignment not necessary when Other names can be selected for recipients.

Die zugewiesenen Bitfolgen sollten so kurz wie möglich gehalten werden. Werden dafür Codes konstanter Länge benutzt, das heißt allen Variablennamen wird die gleiche Länger der Bitfolge zugeordnet, so kann die Länge n der Bitfolge einfach berechnet werden durch Bildung des Logarithmus zur Basis 2 von der entsprechenden Anzahl und Rundung auf die nächst größere ganze Zahl. Es muß dann entweder die Länge der Bitfolge oder die Anzahl der Variablennamen mit übertragen werden. Bei Verwendung von Codes variabler Länge muß für eine optimale Zuordnung vorher die Häufigkeit des Auftretens bestimmt werden. Der verwendete Code muß dann sender- und empfangsseitig bekannt sein.The assigned bit strings should be as short as possible being held. For this purpose, codes of constant length is used, i.e. all variable names are the same Assigned longer to the bit sequence, the length n of the Bit sequence can be calculated simply by forming the Logarithm to base 2 of the corresponding number and Rounding to the next larger whole number. Then it has to either the length of the bit string or the number of Variable names are also transferred. When using Codes of variable length must be used for optimal allocation the frequency of occurrence must be determined beforehand. Of the The code used must then be known on the sender and receiver side be.

Die Darstellung von Konstanten und Zeichenfolgen kann entweder einheitlich über Zeichenketten erfolgen, wobei Zeichenketten in ASCII-Form (mit 7 oder 8 Bit) dargestellt werden. Handelt es sich bei den Konstanten um Zahlen, so wird aus Effizienzgründen in der bevorzugten Realisierung nicht auf die ASCII-Darstellung zurückgegriffen. Integerzahlen werden in dieser Realisierung dabei mit der unten beschriebenen n*(7+1)-Bit Methode codiert, die Zahlen beliebiger Größe verarbeiten kann. Zahlen in Gleitkommadarstellung mit einfacher oder doppelter Genauigkeit werden dabei als 2 Integerzahlen dargestellt, wobei die Integerzahlen entweder als Mantisse und Exponent oder als Vorkomma- und Nachkommawert interpretiert werden. The representation of constants and strings can either consist of strings, where Character strings shown in ASCII form (with 7 or 8 bits) will. If the constants are numbers, then is in the preferred implementation for reasons of efficiency did not use the ASCII representation. Integers are in this implementation with the The n * (7 + 1) bit method described below encodes the numbers can process any size. Numbers in Floating point display with single or double Accuracy is represented as 2 integers, where the integers are either mantissa and exponent or interpreted as pre-decimal and post-decimal values.  

Diese Bitfolgen werden so gewählt und synataktisch sinnvoll so kombiniert, daß ein eindeutiger und decodierbarer Bitstrom entsteht, der die Rekonstruktion eines syntaktisch und logisch gleichwertigen Programmes erlaubt.These bit sequences are selected in this way and make sense syntactically combined so that a clear and decodable Bitstream arises, which is the reconstruction of a syntactic and logically equivalent programs allowed.

Die Erfindung wird nun anhand eines in den Zeichnungen dargestellten Ausführungsbeispiels näher beschrieben.The invention is now based on one in the drawings illustrated embodiment described in more detail.

In der Zeichnung ist folgendes dargestellt:The following is shown in the drawing:

Fig. 1 Phasen bzw. Schritte der Programmübersetzung; Fig. 1 phases or steps of program translation;

Fig. 2 ein vereinfachtes Beispiel für einen von der Syntaxanalyse erzeugten abstrakten Baum und Fig. 2 is a simplified example of a generated by the syntax analysis tree abstract and

Fig. 3 Schritte zur Festlegung des Umsetzers. Fig. 3 steps to determine the converter.

Im folgenden wird ein Beispiel für eine Komprimierung gegeben. Hier besteht der komprimierte Bitstrom wesentlich aus Codesymbolen fester Länge. Das Beispiel bezieht sich auf die Programmierhochsprache C/C++ und beschreibt nicht den vollen Sprachumfang, kann aber einfach auf den vollen Umfang erweitert werden.The following is an example of compression given. Here the compressed bit stream is essentially there from fixed length code symbols. The example relates to the high level C / C ++ programming language and does not describe the full range of languages, but can easily be changed to the full Scope to be expanded.

Jedes Hochsprachenprogramm besteht aus verschiedenen unterschiedlichen Teilen und Anweisungsarten. Jeder Teil bzw. Anweisungsart beginnt in dieser Realisierung mit einem entsprechenden "Startcode", dessen Länge von der Anzahl der benötigten Startcodes abhängt. Ein Beispiel der wesentlichsten Anweisungsarten ist in Tabelle 1 gegeben. Für die Beschreibung des vollen Sprachumfanges werden weitere Startcodes benötigt. Each high-level language program consists of different ones different parts and types of instructions. Every part or instruction type begins with a in this implementation corresponding "start code", the length of which depends on the number of required start codes. An example of the The most important types of instruction are given in Table 1. For the description of the full range of languages additional start codes required.  

Tabelle 1 Table 1

Startcodes für Programmteile bzw. Anweisungen Start codes for program parts or instructions

Im folgenden werden Beispiele für einige dieser Programmteile bzw. Anweisungen gegeben.The following are examples of some of these Program parts or instructions given.

Darstellung von IntegerzahlenRepresentation of integers

Die folgende Art der Darstellung von Integerzahlen wird in dieser Realisierung verwendet: Das Vorzeichen wird über 1 Bit signalisiert, der Betrag in das duale Zahlensystem gewandelt. Diese Darstellung wird in Stücke der Länge von 7 Bit unterteilt. Die Anzahl der Stücke ergibt die für die Übertragung benötigte Anzahl von Bytes. Das noch freie Bit des Bytes wird mit einer Signalisierung belegt, ob für die Darstellung weitere Bits folgen (n*(7+1)-Bit Darstellung).The following way of representing integers is in used in this implementation: The sign is over 1 Bit signals the amount in the dual number system changed. This representation is cut into pieces of length 7 Bit divided. The number of pieces gives that for the Transfer required number of bytes. The still free bit of the byte is signaled as to whether for the Representation of further bits follow (n * (7 + 1) bit representation).

Der "include" TeilThe "include" part

Werden dem Compiler bekannte Files durch die "include"- Anweisung eingefügt, so kann jedem dieser bekannten Files ein Codesymbol zugeordnet werden. Ein Beispiel hierfür gibt Tabelle 2.Are files known to the compiler by the "include" - Instruction inserted, so each of these known files a code symbol can be assigned. An example of this is there Table 2.

Tabelle 2 Table 2

Codeworte für bekannte Dateien Code words for known files

Der Teil mit "include"-Anweisungen hat in dieser Realisierung folgende Gestalt:The part with "include" statements has in this Realization following form:

#include <fstream.h<
#include <string.h<
#include <iostream.h<
#include <ctype.h<
#include <stdio.h<
#include <stdlib.h<,
#include <fstream.h <
#include <string.h <
#include <iostream.h <
#include <ctype.h <
#include <stdio.h <
#include <stdlib.h <,

so kann er dann durch die folgende Bitsequenz dargestellt werden, bei der zuerst die binäre Zuordnung für "#include" kommt, dann wird durch ein Bit gekennzeichnet, ob es sich um dem Compiler bekannte Dateien oder um eigene Dateien handelt. Es folgen dann die Anzahl der dem Compiler bekannten einzufügenden Dateien, und dann die Codes für die einzelnen Dateien. Da keine negativen Zahlen auftreten können, entfällt hier die Signalisierung für das Vorzeichen. Somit ergibt sich die folgende Bitfolge:
00010 0 0000110(0) 0110 0001 0010 0011 0100 0101
it can then be represented by the following bit sequence, in which the binary assignment for "#include" comes first, then a bit indicates whether the compiler knows files or own files. The number of files known to the compiler to be inserted then follows, and then the codes for the individual files. Since no negative numbers can occur, there is no signaling for the sign. This results in the following bit sequence:
00010 0 0000110 (0) 0110 0001 0010 0011 0100 0101

Definition von globalen/localen VariablenDefinition of global / local variables

Die reservierten Sprachworte für elementare Datentypen werden wiederum durch Codes dargestellt. Ein Beispiel hierfür ist in Tabelle 3 gegeben.The reserved language words for elementary data types are again represented by codes. An example this is given in Table 3.

Tabelle 3 Table 3

Reservierte Sprachworte für elementare Datentypen Reserved language words for elementary data types

Eine syntaktisch sinnvolle Codierung kann hierbei ähnlich wie im "include"-Teil stattfinden: Zuerst kommt der Startcode, dann die Anzahl der Datentypendefinitionen. In diesem Fall kann der rechte Teil der in Tabelle 3 angegebenen Sprachworte zusätzlich zu den auf der linken Seite der Tabelle angegebenen Sprachworten auftreten. Mit der einfachen Regel, daß zuerst die Codes für die Sprachworte der rechten Seite übertragen werden, kann eine Eindeutigkeit im Bitstrom erreicht werden. Dies bedeutet, daß nach den Codes für "unsigned", "const", "static", "singed", "*" und "[·]" stets noch ein Code für eines der Sprachworte "int", "char", "short", "long", "float", "double", "void" erwartet wird. Bei Feldern wird auch "[·]" auftreten, nach dem Code für die Variablennamen werden noch eine entsprechende Zahl von Integerwerten erwartet. Die Rekonstruktion ist eindeutig.A syntactically meaningful coding can be similar here as in the "include" part: First comes the  Start code, then the number of data type definitions. In In this case, the right part of the table 3 Language words specified in addition to those on the left Language words specified on the side of the table occur. With the simple rule that first the codes for the Language words on the right-hand side can be transmitted Uniqueness in the bit stream can be achieved. This means, that according to the codes for "unsigned", "const", "static", "singed", "*" and "[·]" always a code for one of the Words "int", "char", "short", "long", "float", "double", "void" is expected. For fields also "[·]" occur after the code for the variable names are still a corresponding number of integer values is expected. The Reconstruction is clear.

Die Variablen können einfach durchnumeriert werden, die für die Codierung nötige Bitmenge kann entweder aus der Anzahl der Variablen - sofern diese mit übertragen wird - berechnet werden, oder sie muß mitübertragen werden.The variables can simply be numbered, those for the amount of bits required for coding can either be from the number the variable - if it is also transferred - be calculated, or it must also be transferred.

Tabelle 4 Table 4

Zahl der nötigen Bits zur Darstellung des Variablennamens bzw. des Instanzennamens. Number of bits required to represent the variable name or the instance name.

Beispielexample

char*element;
char*buffer[1000];
int matrix[10] [10];
gibt dann den folgenden Bitstrom:
00100 (Startcode) 0000011(0) (Zahl der Variablen) 1101 ("*") 0010 ("char") 00 (nullte Variable) 1101 ("*") 1110 ("[ ]") 0010 ("char") 01 (erste Variable) 0000111(1)1101000(0) (Feldgröße) 1110 ("[ ]") 1110 ("[ ]") 0001 ("int") 10 (zweite Variable) 000110(0) (Feldgröße) 000110(0) (Feldgröße)
Auf Empfängerseite kann dies dann rekonstruiert werden zu:
char * v0;
char * v1[1000];
int v2[10] [10];
mit anderen Namen für die Variablen. Im Decoder müssen diese Namen natürlich in konsistenter Weise verwendet werden.
char * element;
char * buffer [1000];
int matrix [10] [10];
then gives the following bitstream:
00100 (start code) 0000011 (0) (number of variables) 1101 ("*") 0010 ("char") 00 (zeroth variable) 1101 ("*") 1110 ("[]") 0010 ("char") 01 (first variable) 0000111 (1) 1101000 (0) (field size) 1110 ("[]") 1110 ("[]") 0001 ("int") 10 (second variable) 000110 (0) (field size) 000110 (0 ) (Field size)
On the recipient side, this can then be reconstructed to:
char * v0;
char * v1 [1000];
int v2 [10] [10];
with different names for the variables. Of course, these names must be used consistently in the decoder.

Beginn des "main"-ProgrammesStart of the "main" program

Die Folge: "main() {" kann einfach durch den Startcode wiedergegeben werden. Der entsprechende Code für "end of program" wird dann im Decoder umgesetzt in "};". Bei Übergabe von Argumenten müssen entsprechende Erweiterungen stattfinden.The consequence: "main () {" can be done simply by the start code are reproduced. The corresponding code for "end of program "is then converted into"}; "in the decoder Passing arguments need appropriate extensions occur.

InstanzenbildungInstance building

Die Instanzenbildung von C++ erfolgt analog zur Definition der elementaren Basistypen. Eine eventuell erforderliche Übertragung der Zuordnung von Originalklassennamen zur Darstellung in einer Bitfolge findet vor der Instanzierung statt. C ++ is created in the same way as the definition the basic elementary types. Any necessary Transfer of the assignment of original class names to Representation in a bit sequence takes place before the instantiation instead of.  

Beispielexample

Klassenname *kl_instanz;
ergibt, abgesehen vom Startcode und von der Anzahl der zu bildenden Instanzen,
1101(*) 001 (Bitsequenz für den Klassennamen) 0000 (Instanznr. 0),
wobei angenommen wurde, daß 3 Bit für den Klassennamen und 4 Bit für eine Instanz erforderlich sind.
Class name * kl_instanz;
apart from the start code and the number of instances to be formed,
1101 (*) 001 (bit sequence for the class name) 0000 (instance number 0),
assuming that 3 bits are required for the class name and 4 bits for an instance.

Definition von MethodenDefinition of methods

Wurde zwischen elementaren Datentypen, Strukturen und Klassen unterschieden, das heißt wurden für jeden Typ eigene Bitzuordnungstabellen erstellt, - wie in dieser Realisierung -, so muß nach dem Startcode eine Signalisierung erfolgen, was für ein Datentyp für die Rückgabe vorgesehen ist, andernfalls kann diese Signalisierung entfallen. Der Datentyp für den Rückgabeparameter kann dann entsprechend spezifiziert werden. Werden, wie in dieser Realisierung, die Codeworte für Strukturen und Klassen mit einer "0" begonnen (analog wie in Tabelle 3 die Codeworte für elementare Datentypen), so können auch die zusätzlichen Datentypen der rechten Seite von Tabelle 3 mitverwendet werden, die Eindeutigkeit ist dann garantiert. Es folgt der Code für den Klassennamen, der Code für den Namen der Methode und ein weiteres Bit zur Signalisierung, ob diese Methode mit Parametern aufgerufen wird. Wenn ja, kann dann die Anzahl folgen und die Parameter können analog zur Definition der Variablen/Strukturen/Instanzen codiert werden. Hierbei ist natürlich darauf zu achten, daß entweder die benutzte Bitmenge groß genug ist, um klasseninterne Parameter und Argumente damit darstellen zu können, oder es wird eine entsprechende Signalisierung benutzt. Was between elementary data types, structures and Classes differed, that is, for each type created their own bit allocation tables - as in this one Realization -, so after the start code Signaling take place, what a data type for the Return is provided, otherwise this can No signaling. The data type for the Return parameters can then be specified accordingly will. As in this implementation, become the code words for structures and classes started with a "0" (analog as in Table 3 the code words for elementary data types), so can the additional data types of the right Side of Table 3 are used, the uniqueness is then guaranteed. The code for the follows Class name, the code for the name of the method and a another bit for signaling whether this method with Parameters is called. If so, then the number follow and the parameters can be analogous to the definition of the Variables / structures / instances are coded. Here is of course to make sure that either the one used Is large enough to include internal parameters and To be able to present arguments with it, or it becomes a appropriate signaling used.  

Aufruf einer MethodeCall a method

Findet nicht gleichzeitig noch eine Zuweisung statt, so wird zuerst der Startcode kommen, dann die Bits für die Klasseninstanz. Der sich anschließende "·" oder "→" kann mit einem Signalisierungsbit übertragen werden. Es folgt dann die Bitfolge für die Methode. Im allgemeinen ist die Anzahl der Argumente nicht bekannt, es folgt also eine Signalisierung, ob und wenn ja, wie viele Argumente vorhanden sind. Diese werden dann ebenfalls in Bitfolgen umgesetzt. Haben Variable, Strukturen, Instanzen und Methoden/Funktionen keine einheitliche Bitfolgenzuordnung, so muß, - wenn die Definition der Funktion/Methode nicht bekannt ist und damit der Datentyp dem Decoder nicht bekannt ist -, jeweils durch zum Beispiel 2 Bit signalisiert werden, um welchen Typ es sich bei dem jeweiligen Argument handelt.If there is no assignment at the same time, so the start code will come first, then the bits for the Class instance. The subsequent "·" or "→" can be transmitted with a signaling bit. It follows then the bit string for the method. In general it is Number of arguments not known, so one follows Signaling whether and if so, how many arguments available. These are then also in bit sequences implemented. Have variables, structures, instances and Methods / functions no uniform bit sequence assignment, so must - if the definition of the function / method does not is known and therefore the data type is not known to the decoder is known - in each case, for example, by 2 bits be signaled which type it is respective argument.

AusführungsanweisungenInstructions for execution

Die meisten Ausführungsanweisungen sind recht kurz, und oft ist die Folge von Variablen/Strukturen/Instanzen (v), Sonderzeichen/Operatoren (o) und Konstanten/Strings (c) häufig vorhanden, so daß es sinnvoll ist, für häufig vorkommende derartige Folgen einen eigenen Code zu verwenden. Dabei können auch spezielle Anweisungen wie zum Beispiel "variable++;" oder "variable=0;" einen eigenen Code erhalten. Ein kurzes Beispiel einer derartigen Zuordnung ist in der folgenden Tabelle gegeben. Vor der Codierung der Konstanten/Strings wird eine Signalisierung gesetzt, die angibt, um was es sich im folgenden handelt. Most instructions are short, and often is the sequence of variables / structures / instances (v), Special characters / operators (o) and constants / strings (c) common, so it makes sense for frequent occurring sequences of this kind have their own code use. Special instructions such as Example "variable ++;" or "variable = 0;" an own Get code. A brief example of one Assignment is given in the following table. Before the Coding the constants / strings becomes signaling set, which indicates what it is in the following.  

Tabelle 7 Table 7

Beispiel für die Zuordnung einiger häufiger Folgen von Variablen/Strukturen/Instanzen (v), Sonderzeichen/Operatoren (o) und Konstanten/Strings zu Bitfolgen Example of the assignment of some common sequences of variables / structures / instances (v), special characters / operators (o) and constants / strings to bit sequences

Der in der folgenden Tabelle angegebene Code für das Sonderzeichen ";" tritt nur in Verbindung mit "escape" auf. Ist die Folge von Variablen/Strukturen/Instanzen (v), Sonderzeichen/Operatoren (o) und Konstanten/Strings (c) bekannt, so ist das Sonderzeichen ";" nicht erforderlich. The code for the specified in the following table Special character ";" occurs only in connection with "escape". Is the sequence of variables / structures / instances (v), Special characters / operators (o) and constants / strings (c) known, the special character ";" not mandatory.  

Tabelle 8 Table 8

Beispiel für die Zuordnung der Sonderzeichen zu Bitfolgen Example of the assignment of special characters to bit sequences

Im folgenden Beispiel wird der Startcode nicht mit aufgeführt, vier Bits seien für die Darstellung von Variablen nötig. Die Unterscheidung zwischen Variablen, Strukturen, Instanzen und Methoden/Funktionsaufrufen geschieht hier mit einem 2-Bit-Flag.In the following example, the start code is not included listed, four bits are for the representation of Variables needed. The distinction between variables, Structures, instances and methods / function calls happens here with a 2-bit flag.

Um komplexeren Anweisungen, deren Reihenfolge nicht in der obigen Tabelle aufgenommen ist, Bitfolgen zuzuweisen, kann "escape" mit einer modifizierten Syntaxstruktur benutzt werden, deren Struktur wohl am besten aus dem folgenden Beispiel hervorgeht. Durch entsprechende Signalisierung wird dabei stets angegeben, was als nächstes zu erwarten ist:
Variable/Struktur/Instanz
Sonderzeichen/Operator
Funktion/Methodenaufruf
In Fällen, in denen diese Signalisierung nicht ausreicht, folgt eine zweite Signalisierung.
In order to assign bit sequences to more complex instructions, the order of which is not included in the table above, "escape" can be used with a modified syntax structure, the structure of which is probably best shown in the following example. Appropriate signaling always indicates what to expect next:
Variable / structure / instance
Special characters / operator
Function / method call
In cases where this signaling is not sufficient, a second signaling follows.

Beispielexample

Der AnweisungThe instruction

buffer[i]=((i+k)/(buf-1))&[k];buffer [i] = ((i + k) / (buf-1)) &[k];

kann dann, abgesehen wiederum vom Startcode, die folgende Bitfolge zugeordnet werden:
11111 (escape) 01 (Variable/Struktur/Instanz folgt) 01 (Variable folgt) 0001 (erste Variable) 10 (Sonderzeichen/Operator folgt) 10010 (Sonderzeichen: [) 01 (Variable/Struktur/Instanz folgt) 01 (Variable folgt) 0010 (zweite Variable) 10 (Sonderzeichen/Operator folgt) 11110 (Sonderzeichen: ]=) 10 (Sonderzeichen/Operator folgt) 11111 (Code für Befehlsende:) usw.
apart from the start code, the following bit sequence can then be assigned:
11111 (escape) 01 (variable / structure / instance follows) 01 (variable follows) 0001 (first variable) 10 (special character / operator follows) 10010 (special character: [) 01 (variable / structure / instance follows) 01 (variable follows) 0010 (second variable) 10 (special character / operator follows) 11110 (special character:] =) 10 (special character / operator follows) 11111 (code for command end :) etc.

Die Benutzung von "escape" benötigt im allgemeinen eine größere Bitmenge als wenn eine der vordefinierten Folgen von Variablen/Strukturen/Instanzen (v) Sonderzeichen/Operatoren (o) und Konstanten/Strings (c) benutzt wird.The use of "escape" generally requires one greater amount of bits than if one of the predefined sequences of variables / structures / instances (v) Special characters / operators (o) and constants / strings (c) is used.

Kontrollanweisungen ("for", "while", "if", "else") "for"Control instructions ("for", "while", "if", "else") "for"

Nach dem Sprachwort "for" werden 3 Ausdrücke, getrennt durch ";" in Klammern erwartet, wobei in diesen Ausdrücken auch Kommas erlaubt sind. Nach dem Startcode für die "for"- Anweisung folgen direkt 3 Ausführungsanweisungen, die natürlich auch leer sein können. Auf Empfängerseite wird dann die entsprechende Syntax mit "for( . . ; . . ; . . ) {′′ wiederhergestellt. Für das Ende der Schleife wird auch ein entsprechender "Startcode" übertragen. Dazwischen können beliebige Anweisungen erfolgen.After the word "for" 3 expressions are separated by ";" expected in parentheses, being in these expressions commas are also allowed. After the start code for the "for" - Instruction directly follow 3 execution instructions that can of course also be empty. On the receiving end then the corresponding syntax with "for (..;..;..) {′ ′ restored. For the end of the loop there is also a transfer the corresponding "start code". In between can any instructions are given.

Im folgenden Beispiel ist "k" die 14. Variable und "element" die 1. Variable. Die AnweisungIn the following example, "k" is the 14th variable and "element" the 1st variable. The instruction

for (k=0; k<element; k++) {for (k = 0; k <element; k ++) {

kann dann die folgende Bitfolge geben:
10000 (start code)
erster Ausdruck:
01001 (vz) 01 (Variable folgt) 1110 (14. Variable)
zweiter Ausdruck:
00100 (vov) 01 (Variable folgt) 1110 (14. Variable) 01111 (Sonderzeichen: <) 01 (Variable folgt) 0001 (1. Variable)
dritter Ausdruck:
01000 (vp) 01 (Variable folgt) 1110 (14. Variable)
can then give the following bit sequence:
10000 (start code)
first expression:
01001 (vz) 01 (variable follows) 1110 (14th variable)
second expression:
00100 (vov) 01 (variable follows) 1110 (14th variable) 01111 (special character: <) 01 (variable follows) 0001 (1st variable)
third expression:
01000 (vp) 01 (variable follows) 1110 (14th variable)

"while""while"

Der Unterschied zur "for"-Anweisung besteht ausschließlich in der Anzahl der in Klammern nachfolgenden Ausdrücke, die Syntax kann also analog erfolgen.The difference to the "for" statement is only in the number of expressions in parentheses that So syntax can be done analogously.

"if""if"

Analog zur "while"-Anweisung erwartet die "if"-Anweisung ebenfalls einem Ausdruck, die Syntax erfolgt analog zu "while". Der Startcode für das Ende der "if"-Schleife wird dann im Decoder umgesetzt in "};", der Code für die "else"- Anweisung wird im Empfänger wieder umgesetzt in ′′} else {′′, so daß vor der "else"-Anweisung kein Code zu erfolgen hat, der das Ende der "if"-Anweisung gibt. Die "elseif"- Anweisung muß ebenfalls "}" mit erzeugen, erwartet ansonsten aber auch einen Ausdruck.Analogous to the "while" statement, the "if" statement expects also an expression, the syntax is analogous to "while". The start code for the end of the "if" loop is then implemented in the decoder in "};", the code for the "else" - Instruction is implemented again in the receiver in ′ ′} else {′ ′, so that there is no code to do before the "else" statement, which gives the end of the "if" statement. The "elseif" Instruction must also generate "}", expected otherwise also an expression.

Claims (9)

1. Umsetzer zur Übertragung von Quellencode, insbesondere einer Hochsprache wie zum Beispiel C/C++, Fortran oder Java in einen Bitstrom für die Übertragung, wobei die empfängerseitige Rekonstruktion einen syntaktisch und logisch gleichwertigen Programmcode liefert, dadurch gekennzeichnet,
daß ein mittels Syntaxanalyse erzeugter abstrakter Baum in biteffizienter Weise codiert wird und
daß zur Festlegung des Umsetzers reservierten oder speziellen Sprachworten kurze Bitfolgen zugeordnet werden,
daß mittels lexikalischer Analyse den Symbolen kurze Bitfolgen zugeordnet werden,
daß aufgrund der lexikalischen Analyse auch Konstanten in Bitfolgen umgesetzt werden,
daß Anweisungen wie Deklaration, Funktionsaufruf, arithmetische Anweisung usw., Schlüsselworte als kurze Bitfolgen zugeordnet werden,
daß die Struktur eines jeweiligen Teilbaumes angegeben wird, falls diese Struktur nicht eindeutig mit dem Schlüsselwort festgelegt ist,
daß Schlüsselworte und Bitfolgen in eindeutiger Weise kombiniert werden und
daß für Symbole, die nach außen bekannt sein müssen, die Zuordnung des Symbols zu der intern benutzten Bitfolge mit übertragen wird.
1. Converter for the transmission of source code, in particular a high-level language such as C / C ++, Fortran or Java, into a bit stream for the transmission, the reconstruction on the receiver side providing a syntactically and logically equivalent program code, characterized in that
that an abstract tree generated by means of syntax analysis is coded in a bit-efficient manner and
that short bit sequences are assigned to reserved or special language words to determine the converter,
that short bit sequences are assigned to the symbols by means of lexical analysis,
that based on the lexical analysis, constants are also converted into bit sequences,
statements such as declaration, function call, arithmetic statement etc., keywords are assigned as short bit sequences,
that the structure of a respective subtree is specified, if this structure is not clearly defined with the keyword,
that keywords and bit strings are uniquely combined and
that for symbols that must be known to the outside world, the assignment of the symbol to the internally used bit sequence is also transmitted.
2. Verfahren nach Patentanspruch 1, dadurch gekennzeichnet, daß bei Verwendung von variablen Längencodes für die Symbole, zum Beispiel bei Huffmann oder Entropiecodierung, die Häufigkeit jedes Symboles bestimmt wird und eine entsprechende Zuordnung zu Bitfolgen möglichst geringer Länge erfolgt und/oder für die reservierten Sprachworte (inklusive Sonderzeichen und Operatoren) die Häufigkeit jedes reservierten Sprachwortes bestimmt wird und eine entsprechende Zuordnung zu Bitfolgen möglichst geringer Länge erfolgt.2. The method according to claim 1, characterized featured, that when using variable length codes for the Symbols, for example at Huffmann or Entropy coding, the frequency of each symbol is determined and a corresponding assignment to Bit sequences of the smallest possible length occur and / or for the reserved language words (inclusive Special characters and operators) the frequency of each reserved language word is determined and a appropriate assignment to bit sequences if possible short length. 3. Verfahren nach Patentanspruch 1, dadurch gekennzeichnet, daß bei Verwendung fester Längencodes für die Symbole diesen entsprechende Bitfolgen zugeordnet werden, wobei die Länge der Bitfolge von der Anzahl der Symbole abhängt und die Länge oder die Anzahl mit übertragen wird und/oder für die reservierten Sprachworte (inklusive Sonderzeichen und Operatoren) diesen feste Bitfolgen zugeordnet werden, die wesentlich weniger Bits benötigen als die direkte Darstellung.3. The method according to claim 1, characterized featured, that when using fixed length codes for the symbols corresponding bit sequences are assigned to them, where the length of the bit string depends on the number of Depends on symbols and the length or number with is transmitted and / or for the reserved Language words (including special characters and operators) these are assigned fixed bit sequences that require significantly fewer bits than the direct one Presentation. 4. Verfahren nach Patentanspruch 2 oder 3, dadurch gekennzeichnet, daß für alle Symbole über eine einheitliche Tabelle eine Zuordnung von Bitfolgen erfolgt.4. The method according to claim 2 or 3, characterized featured, that for all symbols via a uniform table bit sequences are assigned. 5. Verfahren nach Patentanspruch 2 oder 3, dadurch gekennzeichnet, daß für jede Symbolart wie zum Beispiel Variablenname, Funktionsname, Klassenname, Instanz eine eigene Symboltabelle erstellt wird und damit die Zuordnung von Bitfolgen getrennt erfolgt und daß in nicht eindeutigen Fällen die Symbolart mit übertragen wird.5. The method according to claim 2 or 3, characterized featured,  that for each type of symbol such as variable name, Function name, class name, instance its own Symbol table is created and thus the assignment separated from bit sequences and that in not in clear cases the symbol type is also transferred. 6. Verfahren nach Patentanspruch 2 oder 3, dadurch gekennzeichnet, daß häufiger vorkommenden Kombinationen eigene Bitfolgen zugeordnet werden.6. The method according to claim 2 or 3, characterized featured, that more common combinations own Bit sequences can be assigned. 7. Verfahren nach Patentanspruch 1, dadurch gekennzeichnet, daß die Zuordnung von Originalsymbolnamen zu den Bitfolgen dann zusätzlich übertragen wird, wenn diese beim Empfänger bekannt sein müssen.7. The method according to claim 1, characterized featured, that the assignment of original symbol names to the Bit sequences are then additionally transmitted if these must be known to the recipient. 8. Verfahren nach Patentanspruch 3, dadurch gekennzeichnet, daß bei Verwendung fester Längencodes die Länge der Bitfolge berechnet wird durch Bildung des Logarithmus zur Basis 2 von der entsprechenden Anzahl und Rundung auf die nächst größere ganze Zahl, wobei dann entweder die Länge der Bitfolge oder die Anzahl der variablen Namen mit übertragen wird.8. The method according to claim 3, characterized featured, that when using fixed length codes, the length of the Bit sequence is calculated by forming the logarithm to base 2 from the corresponding number and rounding to the next larger integer, then either the length of the bit string or the number of variable Name is transferred with. 9. Verfahren nach einem der Patentansprüche 1 bis 8, dadurch gekennzeichnet,
daß die Darstellung von Konstanten und Zeichenfolgen einheitlich über Zeichenketten erfolgt, wobei die Zeichenketten in ASCII-Form dargestellt werden und
daß Integerzahlen mit der n*(7+1)-Bitmethode codiert werden, wobei Zahlen in Gleitkommadarstellung mit einfacher oder doppelter Genauigkeit als zwei Integerzahlen dargestellt werden und die Integerzahlen entweder als Mantisse und Exponent oder als Vorkomma- und Nachkommawert interpretiert werden.
9. The method according to any one of claims 1 to 8, characterized in
that constants and strings are displayed uniformly using character strings, the character strings being represented in ASCII form and
that integers are encoded using the n * (7 + 1) bit method, where numbers in single-point or double-precision floating-point representation are represented as two integers and the integers are interpreted either as a mantissa and exponent or as a pre-and post-decimal value.
DE19622365A 1996-06-04 1996-06-04 Method for a converter for implementing source code Expired - Lifetime DE19622365B4 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
DE19622365A DE19622365B4 (en) 1996-06-04 1996-06-04 Method for a converter for implementing source code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
DE19622365A DE19622365B4 (en) 1996-06-04 1996-06-04 Method for a converter for implementing source code

Publications (2)

Publication Number Publication Date
DE19622365A1 true DE19622365A1 (en) 1997-12-11
DE19622365B4 DE19622365B4 (en) 2008-08-28

Family

ID=7796091

Family Applications (1)

Application Number Title Priority Date Filing Date
DE19622365A Expired - Lifetime DE19622365B4 (en) 1996-06-04 1996-06-04 Method for a converter for implementing source code

Country Status (1)

Country Link
DE (1) DE19622365B4 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1115207A1 (en) * 1999-07-13 2001-07-11 Sony Corporation Method of generating distribution content, method and apparatus for content distribution, and method of code conversion

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE4437790A1 (en) * 1993-10-22 1995-06-01 Ricoh Kk Channel modulation process for finite state machine with error correction and entropy coding

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5151697A (en) * 1990-10-15 1992-09-29 Board Of Regents Of The University Of Washington Data structure management tagging system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE4437790A1 (en) * 1993-10-22 1995-06-01 Ricoh Kk Channel modulation process for finite state machine with error correction and entropy coding

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LANGDON,Glen G.: An Introduction to Arithmetic Coding. In: IBM J. RES. DEVELOP., Vol.28, No.2, March 1984, S.135-149 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1115207A1 (en) * 1999-07-13 2001-07-11 Sony Corporation Method of generating distribution content, method and apparatus for content distribution, and method of code conversion
EP1115207A4 (en) * 1999-07-13 2001-10-17 Sony Corp Method of generating distribution content, method and apparatus for content distribution, and method of code conversion
US7653752B2 (en) 1999-07-13 2010-01-26 Sony Corporation Distribution contents forming method, contents distributing method and apparatus, and code converting method

Also Published As

Publication number Publication date
DE19622365B4 (en) 2008-08-28

Similar Documents

Publication Publication Date Title
DE60213760T2 (en) METHOD FOR THE COMPRESSION AND DECOMPRESSION OF A STRUCTURED DOCUMENT
EP1522028B9 (en) Method and devices for encoding/decoding structured documents, especially xml documents
DE60310368T2 (en) PROCEDURE FOR PREVENTING START CODE EMULATION AND STOP DATA
DE69931540T2 (en) Remote procedure calls with conversion and reconversion of arbitrary, non-matching pointer sizes
EP1112621B1 (en) Device and method for entropy encoding of information words and device and method for decoding entropy-encoded information words
DE60123596T2 (en) Method for compressing a tree hierarchy, associated signal and method for decoding a signal
EP2068448B1 (en) Method and arrangement for arithmetic encoding and decoding with application of several tables
DE69934939T2 (en) Compression of boundaries between images
DE60107964T2 (en) DEVICE FOR CODING AND DECODING STRUCTURED DOCUMENTS
DE60225785T2 (en) PROCESS FOR CODING AND DECODING A PATH IN THE TREE STRUCTURE OF A STRUCTURED DOCUMENT
DE69933323T2 (en) compiler
DE19622365B4 (en) Method for a converter for implementing source code
WO2002017063A2 (en) Programme coupling method
DE10210663A1 (en) Device for indication of and/or precise operations on numerical values in binary system divides binary coded number by divisor, use results to look up display screen codes in static table
DE69916874T2 (en) AVOIDING UNAUTHORIZED PATTERNS IN AUDIO OR VIDEO DATA
DE4232482A1 (en) Process for realizing an international language network in an international communication network
DE19534207A1 (en) Method for coding or decoding protocol data units (PDU)
DE2042596A1 (en) Circuit arrangement for converting a single coded input character into a plurality of coded output characters
DE10339971A1 (en) Method for coding an XML-based document
DE10248758B4 (en) Methods and devices for encoding / decoding XML documents
DE19803845C2 (en) Method and device for transmitting a message represented by digital data
DE102004001651B4 (en) Method and processor for automatic command mode switching between N-bit and 2N-bit commands using a parity check
DE3113189A1 (en) &#34;METHOD AND DEVICE FOR CONVERTING DIGITAL CHARACTER CODES RECEIVED OR DELIVERED BY A DATA PROCESSING SYSTEM&#34;
DE69814396T2 (en) COMPRESSION CODING METHOD
DE3523247A1 (en) Device for the data reduction of binary data streams

Legal Events

Date Code Title Description
OM8 Search report available as to paragraph 43 lit. 1 sentence 1 patent law
8110 Request for examination paragraph 44
8125 Change of the main classification

Ipc: H03M 730

8364 No opposition during term of opposition
R071 Expiry of right