symbol-table

Build symbol table from grammar [closed]

ⅰ亾dé卋堺 提交于 2019-11-27 05:37:23
I am trying to build a symbol table from my grammar (done with antlr) by using eclipse. However I don't know by what to begin. I think I read somewhere that you would need the parser and lexer generated by antlr to do that. Does someone know an easy example so that I can understand how it works please ? A symbol table is just a versioned map of id's to values. This is one solution, using a push and pop of scopes as the versioning mechanism -- push a scope on entry of a scope defining rule and pop on exit. package net.certiv.metal.symbol; import java.util.ArrayList; import java.util

How to call exported kernel module functions from another module?

旧城冷巷雨未停 提交于 2019-11-27 04:04:11
I'm writing an API as a kernel module that provides device drivers with various functions. I wrote three functions in mycode.c . I then built and loaded the module, then copied mycode.h into < kernel >/include/linux . In a device driver, I have a #include < linux/mycode.h > and call those three functions. But when I build the driver module, I get three linker warnings saying that those functions are undefined . Notes: The functions are declared extern in mycode.h The functions are exported using EXPORT_SYMBOL(func_name) in mycode.c Running the command nm mycode.ko shows all three functions as

What is a symbol table?

余生长醉 提交于 2019-11-26 23:46:53
Can someone describe what a symbol table is within the context of C and C++? There are two common and related meaning of symbol tables here. First, there's the symbol table in your object files. Usually, a C or C++ compiler compiles a single source file into an object file with a .obj or .o extension. This contains a collection of executable code and data that the linker can process into a working application or shared library. The object file has a data structure called a symbol table in it that maps the different items in the object file to names that the linker can understand. If you call a

How are variable names stored in memory in C?

流过昼夜 提交于 2019-11-26 17:56:11
问题 In C, let's say you have a variable called variable_name . Let's say it's located at 0xaaaaaaaa , and at that memory address, you have the integer 123. So in other words, variable_name contains 123. I'm looking for clarification around the phrasing " variable_name is located at 0xaaaaaaaa ". How does the compiler recognize that the string "variable_name" is associated with that particular memory address? Is the string "variable_name" stored somewhere in memory? Does the compiler just

How to call exported kernel module functions from another module?

徘徊边缘 提交于 2019-11-26 11:02:09
问题 I\'m writing an API as a kernel module that provides device drivers with various functions. I wrote three functions in mycode.c . I then built and loaded the module, then copied mycode.h into < kernel >/include/linux . In a device driver, I have a #include < linux/mycode.h > and call those three functions. But when I build the driver module, I get three linker warnings saying that those functions are undefined . Notes: The functions are declared extern in mycode.h The functions are exported

What is a symbol table?

不羁岁月 提交于 2019-11-26 08:47:29
问题 Can someone describe what a symbol table is within the context of C and C++? 回答1: There are two common and related meaning of symbol tables here. First, there's the symbol table in your object files. Usually, a C or C++ compiler compiles a single source file into an object file with a .obj or .o extension. This contains a collection of executable code and data that the linker can process into a working application or shared library. The object file has a data structure called a symbol table