i am developing a compiler for my own defined language , i have generated 3 address code and now i am going to develop a virtual machine which can run that 3 address code. but for that i need Data Segment (where i can store all of my variables values) .i have two data types in my language (int and char) .
please give me a hint that how can i construct a data segment where i can store all of my variables (int and char both) values
thanks reading my problem
Data Segment in Compiler Construction
208 Views Asked by Haider Ali At
1
There are 1 best solutions below
Related Questions in COMPILER-CONSTRUCTION
- Is the compiler Xcode uses to produce Assembly code a bad compiler?
- How do compilers store hundreds of variables in only a few registers?
- Where to patch back the information gathered during program analysis
- Assignment Insertion in ROSE compiler after AssignOp
- memory layout of a multiple-inherited object in C++
- How to use my written compiler to read files on web?
- a LEX program to identify keywords and convert it into uppercase
- Identifier terminal except certain keywords
- Calling Scala compiler's AST from Java
- Computing the FOLLOW() set of a grammar
- JavaCC and Unicode issue. Why \u696d cannot be managed in JavaCC although it belong to the range "\u4e00"-"\u9fff"
- Three-address code and symbol tables
- Delegate caching behavior changes in Roslyn
- Get delimiter in Irony
- Compiler Errors including initializer before '<' token
Related Questions in DATA-SEGMENT
- Is there a C++ equivalent (or equivalent technique) of Perl's __DATA__ segment?
- what's the utility of bss segment?
- What does `Var2 DW Var1` mean in TurboShell/TurboAsm?
- Matplotlib: How can i use a column as data segmentation on matplotlib?
- Storing a vector in a DLL data segment
- why linux set the data-segment to __USER_DS at the prologue of exception handler
- bss segment in C
- How to handle data type conversation in python?
- CRC16 generation function - Error C195 illegal indirection
- Why has the .bss segment not increased when variables are added?
- Executable Ada code on the stack
- intel to ATT assembley conversion for reading data segment of BIOS
- Is there a C function to get the size of a file's data segment?
- Why data segment of C was separated as two sections?
- How to change data segment? What am I doing wrong?
Related Questions in VM-IMPLEMENTATION
- How do compilers store hundreds of variables in only a few registers?
- What is Smali Code Android
- Extends my language at runtime
- optimized dex types in dalvik cache
- Why there is no virtual machine for other languages unlike Java?
- Contents of Stack Frame in Java
- Stack-based virtual machine function call/return implementation issues
- How to write self-modifying code in x86 assembly
- Does the python vm compiles method every time?
- What programming languages will let me manipulate the sequence of instructions in a method?
- Opt-in tail call support in the JVM on a per-language base?
- What's an efficient way to store variables? (Home-Built Virtual Machine)
- Abstracting function parameter format and its effects on performance?
- Advantages of a VM
- How to create binaries for virtual machines?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I strongly recommend to read C.Queinnec's book Lisp In Small Pieces; it explains very well a lot of things related to your questions.
While C.Queinnec's book focus apparently on Lisp-like languages, it teach you concepts which you can apply to a lot of other languages, including your own. In particular, you'll want to formalize more the denotational semantics or operational semantics of your language.
You could also at least study some VM, including Ocaml virtual machine, JVM, Parrot VM, NekoVM, LUA VM...
And you may later want to use just in time compilation techniques, notably with LLVM or libjit etc...
See also http://lambda-the-ultimate.org/
BTW, you may find much more convenient to have your language implementation reuse some existing VM.
I don't grasp why is a data segment such an issue. Your VM usually starts with some heap image, which contain both data and bytecode. A lot of languages have (at least implicitly) closures - or at least objects - mixing code and data.