Questions tagged [symbol-table]

A `symbol table` is a data structure that maps each identifier in a program's source code to information relating to its declaration or appearance in the source.

A symbol table is used by a language translator (compiler, interpreter...) for associating each identifier in a program's source code with information relating to its declaration or appearance in the source (type, scope level, sometimes location...).

A common implementation technique is to use a hash table implementation. A compiler may use one large symbol table for all symbols or use separated, hierarchical symbol tables for different scopes.

202 questions
1
vote
1 answer

Constructing an LC-3 symbol table

I have a question about symbol tables. Now according to my textbook the rules of a symbol table are as follows: Find the .ORIG statement, which tells us the address of the first instruction and initialize location counter (LC), which keeps track of…
1
vote
0 answers

Symbol table in flex/bison

Does anyone know how to use the symbol table in Flex / Bison? I'm preparing a college exam but I can not understand the subject ...I've already tried searching on the internet but I find nothing that is well written.
1
vote
2 answers

C global static variable initialization is done by linker?

Let's say we have: f1.c #include static int x = 10; void f1() { printf("f1.c : %d\n", x); } main.c extern void f1(); int main(int argc, char **argv) { f1(); return 0; } we will compile and read the two ELF file symboltables (rel.…
Seoul
  • 585
  • 1
  • 4
  • 14
1
vote
0 answers

Using existing map file for resolving symbols locations

I have an executable cross compiled for a micro controller and code is actually pic. I want to write a different program with symbols resolved from the map file of previous executable. Is it possible ? Why I need it : This way I can just upload…
zephyr0110
  • 223
  • 1
  • 11
1
vote
2 answers

Symbol Table Vs Set

From sedgewick course, I learnt that, Symbol table Symbol table is a key-value pair abstraction where, given a key, search for the corresponding value. value is not null get() returns null if key not present put() overwrites old value with new…
overexchange
  • 15,768
  • 30
  • 152
  • 347
1
vote
0 answers

Same address for multiple symbols

When reading symbol table from Linux kernel images, I found there are cases that one address is mapped to multiple symbols. What does this mean? And how does loader work for this situation? Are they static functions, or something else? c05eadb0 T…
WindChaser
  • 960
  • 1
  • 10
  • 30
1
vote
1 answer

symbol tables and scope

For the below code I"m trying to draw symbol tables for each scope. The scopes are global, f1, else, and f2. I was wondering if for f2, x would be considered a symbol of that scope. Also, does the f1(5) get associated with any symbol tables? int x =…
greenteam
  • 305
  • 5
  • 16
1
vote
2 answers

Can we hide/obscure symbol names in the symbol table of ELF executable object file?

According to this ELF specification: ELF object file contains various sections and one of them is symbol table section .symtab which contains information of all symbols (files, functions, objects etc). ELF contains information like name, attribute…
Zeeshan
  • 539
  • 4
  • 19
1
vote
1 answer

How to store variables from Symbol Table Compilers

For my class, I have to write a compiler for a tiny subset of Python: This language has one method There aren't functions, so I'm only dealing with one lexical scope This Python subset will be translated to Java bytecode. I've already done…
1
vote
0 answers

Finding from symbol_table is failing in php 7

I have couple of questions. I have written test case like this. $animals = array( array('Spook', 'spook.png'), array('Helmut', 'pic1.jpg') ); foreach($animals as $row){ $name = $row[0]; $picname = $row[1]; $picture =…
abhi7436
  • 43
  • 6
1
vote
0 answers

Exporting TASKLET in kernel module?

I got two kernel modules which both exports some symbols using EXPORT_SYMBOL(). One of them exports basic function (sv1<-sv2) and it works but I got problem with the other one (sv1->sv2). What I want is to export TASKLET. I read somewhere that is…
1
vote
2 answers

Reusing symbol table from semantic analysis phase for code generation

I'm currently building a compiler for a language which has global variable and nested subroutine feature. Previously, I've only ever built a compiler for languages which only has local variable without nested subroutine. I have a problem on how to…
1
vote
0 answers

Symbol mangled with suffix "$UNIX2003", when compiling with proper header included

I'd like to find out which symbol is called when my code runs 'system' function. In my sample code, when the header stdlib.h is specifically included, the symbol is called _system$UNIX2003, and when the header isn't included, there (probably)…
Zohar81
  • 4,554
  • 5
  • 29
  • 82
1
vote
1 answer

Three-address code and symbol tables

I am working on a hobby retargetable C compiler in OCaml and I'm building it bottom up. So far I have an annotated AST type, abridged: type 'e expr = | Int of 'e * int | Var of 'e * var | Neg of 'e * 'e expr | Add of 'e * 'e expr *…
1
vote
1 answer

How can I see all functions of a class?

Mainly I want to see compiler-generated functions (default constructor, copy constructor, assignment-operator, move-assignment, destructor). Just want to see which functions compiler generated for me. I assumed I could see this in the symbol table…
madu
  • 5,232
  • 14
  • 56
  • 96