DE19622365B4 - Method for a converter for implementing source code - Google Patents
Method for a converter for implementing source code Download PDFInfo
- Publication number
- DE19622365B4 DE19622365B4 DE19622365A DE19622365A DE19622365B4 DE 19622365 B4 DE19622365 B4 DE 19622365B4 DE 19622365 A DE19622365 A DE 19622365A DE 19622365 A DE19622365 A DE 19622365A DE 19622365 B4 DE19622365 B4 DE 19622365B4
- Authority
- DE
- Germany
- Prior art keywords
- bit
- bit sequences
- assigned
- assignment
- variable
- 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.)
- Expired - Lifetime
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
- G06F8/425—Lexical analysis
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion 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/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
Verfahren
für einen
Umsetzer zur Umsetzung von Quellencode einer Hochsprache wie zum
Beispiel C/C++, Fortran oder Java in einen Bitstrom für eine Übertragung,
wobei eine empfängerseitige
Rekonstruktion einen syntaktisch und logisch gleichwertigen Programmcode
liefert, dadurch gekennzeichnet,
– dass ein mittels Syntaxanalyse
erzeugter abstrakter Baum in biteffizienter Weise codiert wird,
wobei den reservierten Sprachworten, aber auch den Sonderzeichen
und Operationen feste Bitfolgen zugeordnet werden, die wesentlich
weniger Bits benötigen
als die direkte Darstellung der reservierten Sprachworte und Operatoren/Sonderzeichen
im Rechner,
– dass
zur Festlegung des Umsetzers reservierten oder speziellen- Sprachworten
kurze Bitfolgen zugeordnet werden,
– dass mittels lexikalischer
Analyse den Symbolen kurze Bitfolgen zugeordnet werden,
– dass aufgrund
der lexikalischen Analyse auch Konstanten in Bitfolgen umgesetzt
werden,
– dass
Anweisungen wie Deklaration, Funktionsaufruf, arithmetische Anweisung
u. s. w., Schlüsselworte
als kurze Bitfolgen zugeordnet werden,
– dass die Struktur eines jeweiligen
Teilbaumes angegeben wird, falls diese...Method for a converter for converting source code of a high-level language such as C / C ++, Fortran or Java into a bit stream for a transmission, wherein a receiver-side reconstruction provides a syntactically and logically equivalent program code, characterized
That an abstract tree generated by means of parsing is coded in a bit-efficient manner, the reserved speech words, but also the special characters and operations being assigned fixed bit sequences which require substantially fewer bits than the direct representation of the reserved speech words and operators / special characters in the computer,
That short bit sequences are allocated to reserved or special-language words for the purpose of determining the converter
That by means of lexical analysis the symbols are assigned short bit sequences,
That constants are also converted into bit sequences on the basis of the lexical analysis,
That statements such as declaration, function call, arithmetic instruction, etc., keywords are assigned as short bit sequences,
- that the structure of a particular subtree is specified, if this ...
Description
Die Erfindung betrifft ein Verfahren für einen Umsetzer zur Umsetzung von Quellencode gemäß der im Oberbegriff des Patentanspruchs 1 angegebenen Art.The The invention relates to a method for a converter for the implementation of source code according to the preamble of the patent claim 1 specified type.
Umsetzer von Programmcode in einen Bitstrom für die Umsetzung von Quellcode sind grundsätzlich bekannt. Zum Beispiel muss 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 muss und eine transparente Übertragung nicht erforderlich ist, das heißt der übertragene Code vor der Nutzung im Decoder kompiliert werden muss und keine weitere Bearbeitung des Codes auf Empfängerseite stattfindet, kann ein solcher Umsetzer benutzt werden.converter from program code to a bitstream for the translation of source code are known in principle. For example, in the ISO / IEC expert group MPEG in developing standard MPEG-4 source code or program code with transfer be on the receiving end to generate the decoder. Also in other areas where program code transfer must be and a transparent transfer is not required is, that is the transferred one Code must be compiled before use in the decoder and no further processing of the code on the receiver side can take place such a converter can be used.
Die bekannten Umsetzer von Programmcode in einen Bitstrom für die Übertragung haben jedoch den Nachteil, dass sie nicht biteffizient sind.The known converter of program code in a bit stream for transmission however, have the disadvantage that they are not bit efficient.
Ein gattungsgemäßer Umsetzer zur Umsetzung von Quellcode ist aus dem Artikel von TZAY Y, YOUNG, PHILIPPS S. LIU, „Overhead Storage Considerations and Multilinker Method for Data File Compression", IEEE Transact. On Software Engeneering, vl. SE-6, no. 4, July 1980, Page 340–347 bekannt. Hier ist ein Umsetzer zur Umsetzung von Quellcode einer Hochsprache, wie zum Beispiel C/C++, Fortran oder Java in einen Bitstrom für eine Übertragung, wobei eine empfängerseitige Rekonstruktion einen sysntaktisch und logisch gleichwertigen Programmcode liefert.One generic converter for the conversion of source code is from the article of TZAY Y, YOUNG, PHILIPS S. LIU, "Overhead Storage Considerations and Multilinker Method for Data File Compression ", IEEE Transact. On Software Engineering, from SE-6, no. 4, July 1980, p. 340-347. Here is a translator for translating source code of a high-level language, such as C / C ++, Fortran, or Java into a bit stream for a transmission, being a receiver-side Reconstruction a sysntaktisch and logically equivalent program code supplies.
Der Erfindung liegt deshalb die Aufgabe zugrunde, einen Umsetzer zur Umsetzung von Quellencode dahin gehend zu verbessern, dass ein Quellenprogramm, dass in einer Hochsprache geschrieben ist, so in eine Bitfolge umgesetzt wird, dass zum einen eine möglichst geringe Bitmenge erforderlich ist und zum anderen nach einer Übertragung ein syntaktisch und logisch gleichwertiger Programmcode entsteht.Of the Invention is therefore the object of a converter for Implementation of source code to improve a source code, that is written in a high-level language, so converted into a bit string is that on the one hand as possible small amount of bit is required and the other after a transmission a syntactically and logically equivalent program code is created.
Diese Aufgabe wird durch die kennzeichnenden Merkmale des Patentanspruches 1 in Verbindung mit seinen Oberbegriffsmerkmalen gelöst.These Task is achieved by the characterizing features of claim 1 solved in conjunction with its generic features.
Weitere Merkmale bzw. Ausgestaltungen ergeben sich aus Unteransprüchen.Further Features and embodiments will become apparent from the dependent claims.
Nach der Erfindung wird ein Verfahren für einen Umsetzer zur Umsetzung von Quellencode einer Hochsprache wie zum Beispiel C/C++, Fortran oder Java in einen Bitstrom für eine Übertragung bereitgestellt. Eine empfängerseitige Rekonstruktion liefert dabei einen syntaktisch und logisch gleichwertigen Programmcode. Dabei wird ein mittels Syntaxanalyse erzeugter abstrakter Baum in biteffizienter Weise co diert, wobei den reservierten Sprachworten, aber auch den Sonderzeichen und Operationen feste Bitfolgen zugeordnet werden, die wesentlich weniger Bits benötigen als die direkte Darstellung der reservierten Sprachworte und Operatoren/Sonderzeichen im Rechner. Zudem werden zur Festlegung des Umsetzers reservierten oder speziellen Sprachworten kurze Bitfolgen zugeordnet. Mittels lexikalischer Analyse werden den Symbolen kurze Bitfolgen zugeordnet. Aufgrund der lexikalischen Analyse werden auch Konstanten in Bitfolgen umgesetzt. Anweisungen wie Deklaration, Funktionsaufruf, arithmetische Anweisung u. s. w., werden Schlüsselworte als kurze Bitfolgen zugeordnet. Die Struktur eines jeweiligen Teilbaumes wird angegeben, falls diese Struktur nicht eindeutig mit dem Schlüsselwort festgelegt ist. Schlüsselworte und Bitfolgen werden in eindeutiger Weise kombiniert. Für Symbole, die nach außen bekannt sein müssen, wird die Zuordnung des Symbols zu der intern benutzten Bitfolge mit übertragen. Lediglich häufiger vorkommenden Kombinationen werden eigene Bitfolgen zugeordnet, und das umzusetzende Programm besteht aus mehreren Modulen und Funktionsnamen, Klassennamen und Methode-Namen, die kurzen Bitfolgen zugeordnet werden, so dass für alle Symbole über eine einheitliche Tabelle eine Zuordnung von Bitfolgen erfolgt.To The invention provides a method for a converter for implementation source code of a high-level language such as C / C ++, Fortran or Java into a bitstream for a transmission provided. A receiver side Reconstruction provides a syntactically and logically equivalent Program code. This is an abstract generated by syntax analysis Tree coded in a bit-efficient manner, using the reserved speech words, but also the special characters and operations are assigned fixed bit sequences, which require much less bits as the direct representation of the reserved speech words and operators / special characters in the calculator. In addition, reserved for the determination of the converter or special short words associated with specific speech words. through lexical analysis, the symbols are assigned short bit sequences. Due to lexical analysis, constants also become bit sequences implemented. Statements like declaration, function call, arithmetic Instruction u. s. w., become keywords assigned as short bit strings. The structure of a respective subtree is specified if this structure is not unique with the keyword is fixed. Keywords and bit strings are uniquely combined. For symbols, the outside must be known becomes the assignment of the symbol to the internally used bit string with transfer. Only more common occurring combinations are assigned their own bit sequences, and the program to be implemented consists of several modules and function names, Class names and method names associated with short bit strings be so for all symbols above a uniform table takes place an assignment of bit sequences.
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.By these measures becomes a direct bit efficient converter of program code into one Bitstream for the transfer created. The receiver side Reconstruction 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 the abstract tree generated by the parsing becomes bit-efficient Encoded with the reserved speech words, but also the Special characters and operators are assigned fixed bit sequences, which require much less bits as the direct representation of the reserved speech words and operators / special characters in the calculator. It can frequently occurring combinations own bit sequences are assigned.
Besteht ein Programm aus mehreren Modulen, so werden den Funktionsnamen, Klassennamen und Methode-Namen 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, muss 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.Consists a program of several modules, so the function name, Class names and method names also associated with short bit strings; the length the bit string depends from the number of names. As far as these original names known to the recipient have to be because, for example, not the entire package is transmitted, this must be Transfer table with become. Otherwise, this is not required, the corresponding Bit sequences can new names are assigned. Are the original names already at the receiver? known and the corresponding modules already exists, so is 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 dass auf die Übertragung einer Zuordnung von Originalnamen zu Bitfolgen verzichtet werden kann. Ansonsten muss diese Zuordnung in Tabellenform übertragen werden, zumindest für diejenigen Originalnamen, deren Kenntnis im Empfänger erforderlich ist.at the global variables, structures and instances are similar Applied principles. Again, the original name at the receiver usually not required, so that on the transfer of an assignment from original names to bit sequences can be dispensed with. Otherwise This assignment must be transferred in tabular form, at least for those Original names whose knowledge is required in the consignee.
Bei lokalen Variablen, Strukturen und Instanzen ist die Übertragung der Zuordnung nicht erforderlich, beim Empfänger können andere Namen gewählt werden.at local variables, structures and instances is the transmission the assignment is not required, other names can be selected for the recipient.
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 muss dann entweder die Länge der Bitfolge oder die Anzahl der Variablennamen mit übertragen werden. Bei Verwendung von Codes variabler Länge muss für eine optimale Zuordnung vorher die Häufigkeit des Auftretens bestimmt werden. Der verwendete Code muss dann sender- und empfangsseitig bekannt sein.The Assigned bit strings should be kept as short as possible. Become for codes constant length used, that is all variable names are assigned the same length of the bit sequence, so can the length n the bit sequence can be easily calculated by forming the logarithm to base 2 of the corresponding number and rounding to the next larger whole Number. It must then either the length of the bit sequence or the number the variable name with transferred become. When using variable length codes must beforehand for optimal allocation the frequency the occurrence are determined. The code used must then be sender- and be known at the receiving end.
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 zwei Integerzahlen dargestellt, wobei die Integerzahlen entweder als Mantisse und Exponent oder als Vorkomma- und Nachkommawert interpretiert werden.The Representation of constants and strings can be either uniform over strings where strings are represented in ASCII form (with 7 or 8 bits) become. If the constants are numbers then they will turn out efficiency, not in the preferred implementation to the ASCII representation resorted. Integer numbers are used in this realization with the below coded n * (7 + 1) -bit method, the numbers of any Process size can. Numbers in floating-point representation with single or double Accuracy is represented as two integers, where the integer numbers either as a mantissa and exponent or as an integer and decimal value are interpreted.
Diese Bitfolgen werden so gewählt und syntaktisch sinnvoll so kombiniert, dass 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 syntactically meaningfully combined so that a unique and decodable Bitstream arises, which is the reconstruction of a syntactic and logically equivalent program allowed.
Die Erfindung wird nun anhand eines in den Zeichnungen dargestellten Ausführungsbeispiels näher beschrieben.The Invention will now be described with reference to an illustrated in the drawings embodiment described in more detail.
Es zeigen:It demonstrate:
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.in the Following is an example of given a compression. Here is the compressed bitstream essentially of code symbols of fixed length. The example refers to the programming language C / C ++ and does not describe the full Language scope, but can easily be expanded to the full extent become.
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.
Im folgenden werden Beispiele für einige dieser Programmteile bzw. Anweisungen gegeben.in the following are examples of given some of these program parts or instructions.
Darstellung von IntegerzahlenRepresentation of integer numbers
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 The following type of representation of integers is in this realization used: The sign is over 1 bit signals that the amount has been converted to the dual number system. This presentation will be in pieces the length divided by 7 bits. The number of pieces gives the for the transfer needed Number of bytes. The still free bit of the byte will be signaled occupied, whether for the display is followed by further bits (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.
Der
Teil mit "include"-Anweisungen hat
in dieser Realisierung folgende Gestalt:
#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 0101The part with include statements has the following form in this realization:
#include <fstream.h>
#include <string.h>
#include <iostream.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>,
so it can then be represented by the following bit sequence, in which first the binary assignment for "#include" comes, then is marked by a bit, whether it is the compiler known files or their own files. This is followed by the number of files known to the compiler, and then the codes for each file. Since no negative numbers can occur, the signaling for the sign is omitted here. This results in the following bit sequence:
00010 0 0000110 (0) 0110 0001 0010 0011 0100 0101
Definition von globalen/lokalen 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.
Eine syntaktisch sinnvolle Codierung kann hierbei ähnlich wie im "include"-Teil stattfinden: Zuerst kommt der Startcode, dann die Anzahl der Datentypen definitionen. 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, dass zuerst die Codes für die Sprachworte der rechten Seite übertragen werden, kann eine Eindeutigkeit im Bitstrom erreicht werden. Dies bedeutet, dass 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 take place here similar to the "include" part: First comes the start code, then the number of data type definitions. In this case, the right part may be as shown in Table 3 Speech words in addition to the words on the left side of the table occur. With the simple rule that first the codes for the speech words transferred to the right side uniqueness in the bitstream can be achieved. This means that after the codes for "unsigned", "const", "static", "singed", "*" and "[.]" always another code for one of the speech words "int", "char", "short", "long", "float", "double", "void" is expected. at Fields will also occur after "[.]" the code for the Variable names will still have a corresponding number of integer values expected. The reconstruction is clear.
Die
Variablen können
einfach durch nummeriert 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 muss mitübertragen
werden.
Beispielexample
- char*element;char * element;
- char*buffer[1000];char * buffer [1000];
- int matrix[10] [10];int matrix [10] [10];
- gibt dann den folgenden Bitstrom:then gives the following bitstream:
- 00100 (Startcode) 0000011(0) (Zahl der Variablen)00100 (start code) 0000011 (0) (number of variables)
- 1101 ("*") 0010 ("char") 00 (nullte Variable)1101 ("*") 0010 ("char") 00 (zeroth variable)
- 1101 ("*") 1110 ("[ ]") 0010 ("char") 01 (erste Variable)1101 ("*") 1110 ("[]") 0010 ("char") 01 (first variable)
- 0000111 (1) 1101000 (0) (Feldgröße) 1110 ("[ ]") 11100000111 (1) 1101000 (0) (field size) 1110 ("[]") 1110
- ("[ ]") 0001 ("int") 10 (zweite Variable)("[]") 0001 ("int") 10 (second variable)
- 000110(0) (Feldgröße)000110 (0) (field size)
- 000110(0) (Feldgröße)000110 (0) (field size)
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.On the receiver side, this can then be reconstructed to:
char * v 0;
char * v1 [1000];
int v2 [10] [10];
with different names for the variables. Of course, in the decoder these names have to be used in a consistent way.
Beginn des "main"-ProgrammesBeginning 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 Episode: "main () {" can simply through the start code will be played. The corresponding code for "end of program" will then be in the decoder implemented in "};". At handover of arguments appropriate extensions take place.
Instanzenbildunginstantiation
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.The Instance formation of C ++ is analogous to the definition of elementary Basic types. Any necessary transmission of the assignment of Original class name for representation in a bit sequence takes place before Instantiation takes place.
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, dass 3 Bit für den Klassennamen und 4 Bit für eine Instanz erforderlich sind.Class name * kl_instance; results, except for 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 for the class name and 4 bits for an instance is required.
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 muss 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, dass entweder die benutzte Bitmenge groß genug ist, um klasseninterne Parameter und Argumente damit darstellen zu können, oder es wird eine entsprechende Signalisierung benutzt.Has been distinguished between elementary data types, structures and classes, this means were for each type creates its own bitmap tables, as in This realization, so must after the start code signaling done, what for a data type for the return is provided, otherwise this signaling can be omitted. The data type for the return parameter can then be specified accordingly. Become like this Realization, the code words for Structures and classes started with a "0" (analogous as in Table 3, the code words for elementary data types), so can also the additional ones Data types of the right side of Table 3 are used, the uniqueness is then guaranteed. Below is the code for the class name, the code for the name of the method and another bit to signal if this method is called with parameters. If so, then the number can follow and the parameters can be analog be coded to define the variables / structures / instances. This is natural make sure that either the amount of bits used is large enough is to represent class internal parameters and arguments with it to be able to or a corresponding signaling is used.
Aufruf einer MethodeCalling 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 muss, – 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 an assignment does not take place at the same time, then the start code will come first, then the bits for the class instance. The subsequent "." or "->" can be transmitted with a signaling bit. It then follows the bit sequence for the method. In general, the number of arguments is not known, so there is a signaling, if and if so, how many arguments exist. These are then also converted into bit sequences. If variables, structures, instances and methods / functions do not have a uniform bit sequence assignment, then, if the definition of the function / method is not known and the data type is not known to the decoder, it must be signaled by, for example, 2 bits by which Type, which is the respective argument.
Ausführungsanweisungenexecution instructions
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 dass 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.
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.
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.
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 To assign bit strings to more complex statements whose order is not listed in the above table, escape can be used with a modified syntax structure, the structure of which is best shown in the following example. Through appropriate signaling is always specified what to expect next:
Variable / Structure / Instance
Special characters / Operator
Function / method call
In Fällen, in denen diese Signalisierung nicht ausreicht, folgt eine zweite Signalisierung.In cases in which this signaling is not sufficient, followed by a second Signaling.
Beispielexample
Der
Anweisung
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
Befehlsendes) usw.The instruction
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" required in generally a larger amount of bits as if one of the predefined sequences of variables / structures / instances (v) special characters / operators (o) and constants / strings (c) used becomes.
Kontrollanweisungen
("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 drei Ausführungsanweisungen, die natürlich auch
leer sein können.
Auf Empfängerseite
wird dann die entsprechende Syntax mit "for(..; ..; ..) {"wiederhergestellt.Control statements ("for", "while", "if", "else") "for":
After the language word "for" become 3 expressions, separated by ";" expected in brackets, where commas are allowed in these expressions. After the start code for the "for" instruction, three execution instructions follow directly, which of course can also be empty. On the receiver side, the corresponding syntax is restored with "for (..; ..; ..) {".
Für das Ende der Schleife wird auch ein entsprechender "Startcode" übertragen. Dazwischen können beliebige Anweisungen erfolgen.For the end The loop is also transmitted a corresponding "start code". In between, any Instructions are given.
Im
folgenden Beispiel ist "k" die 14. Variable
und "element" die 1. Variable.
Die Anweisung
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)In the following example, "k" is the 14th variable and "element" is the 1st variable. The instruction
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.Of the There is a difference to the "for" statement exclusively in the number of terms following in parentheses, the 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 dass vor der "else"-Anweisung kein Code zu erfolgen hat, der das Ende der "if"-Anweisung gibt. Die "elseif"-Anweisung muss ebenfalls "}" mit erzeugen, erwartet ansonsten aber auch einen Ausdruck.Analogous expected to "while" statement the "if" statement is also an expression, the syntax is analogous to "while". The start code for the end the "if" loop is then implemented in the decoder in "};", the code for the "else" statement is in receiver implemented again in "} else {", so that no code has to be given before the "else" statement, which gives the end of the "if" statement. The "elseif" statement must also generate "}", but otherwise expects also an expression.
Claims (7)
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 DE19622365A1 (en) | 1997-12-11 |
DE19622365B4 true 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) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4776050B2 (en) | 1999-07-13 | 2011-09-21 | ソニー株式会社 | Delivery content generation method, content delivery method and apparatus, and code conversion method |
Citations (2)
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 |
DE4437790A1 (en) * | 1993-10-22 | 1995-06-01 | Ricoh Kk | Channel modulation process for finite state machine with error correction and entropy coding |
-
1996
- 1996-06-04 DE DE19622365A patent/DE19622365B4/en not_active Expired - Lifetime
Patent Citations (2)
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 |
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 (4)
Title |
---|
LANGDON,Glen G.: An Introduction to Arithmetic Coding. In: IBM J. RES. DEVELOP., Vol.28, No.2, March 1984, S.135-149 * |
Online-Bibliothek Wikipedia: INTEL 8085 * |
REGHBATI H.K.: An Overview of Data Compression Technqiues, IEEE Computer, 14 (1981) 71-76 * |
TZAY Y. YOUNG, PHILIPS S. LIU: Overhead Storage Conbsiderations and a Multilinear Method for Data File Compression. In: IEEE Transact. On Software Engineering, vl. SE-6, No. 4, July 1980,p.340-347 * |
Also Published As
Publication number | Publication date |
---|---|
DE19622365A1 (en) | 1997-12-11 |
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 | |
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 | |
DE3606869A1 (en) | DEVICE FOR DATA COMPRESSION | |
DE2801988A1 (en) | ARITHMETIC CODING OF SYMBOL SEQUENCES | |
DE60107964T2 (en) | DEVICE FOR CODING AND DECODING STRUCTURED DOCUMENTS | |
DE2605724C2 (en) | Digital-to-analog converter for PCM-coded digital signals | |
DE3750390T2 (en) | Simultaneous error detection during coding through arithmetic data coding. | |
DE69933323T2 (en) | compiler | |
DE19622365B4 (en) | Method for a converter for implementing source code | |
DE69028420T2 (en) | Priority order decision device | |
DE102018214541A1 (en) | METHOD AND DEVICE FOR SHAPING SINGLE-STATIC ASSIGNMENT INSTRUCTIONS ON A DATA FLOW GRAPHIC IN A DATA FLOW ARCHITECTURE | |
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 | |
DE2505388A1 (en) | PROCEDURE AND ARRANGEMENT FOR LOGARITHMIC CONVERSION OF A MEASURED VALUE | |
EP0590332A1 (en) | Method for realising an international language bond in an international communication network | |
DE4441293A1 (en) | Method and circuit arrangement for reading code words of variable length from a data memory with a fixed word length | |
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 | |
DE102004001651B4 (en) | Method and processor for automatic command mode switching between N-bit and 2N-bit commands using a parity check | |
DE102019209314A1 (en) | Method and processor device for changing a data format of communication data of a device communication and motor vehicle | |
DE10248758B4 (en) | Methods and devices for encoding / decoding XML documents | |
EP1060565B1 (en) | Compression of data with a syntactic structure |
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 |