• Post Reply Bookmark Topic Watch Topic
  • New Topic

Symbol Table Help  RSS feed

 
ted luton
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ive been Scanning the Internet, And I have come across a Data structure on Java called a Symbol Table, I was wondering if anyone could help me in Creating a Simple Symbol Table.

Which Contains:
- String and Integer Values (Key, Value)
- And has up to 10 Fields
- No Predefined Java Libraries if Possible


Thanks.
 
Campbell Ritchie
Marshal
Posts: 56533
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

It sounds like a kind of Map to me. Would you know how to write your own Map? You can read about Maps in the Java® Tutorials. A Map does not usually have a predefined size, but enlarges as it is filled.
 
ted luton
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Welcome to the Ranch

It sounds like a kind of Map to me. Would you know how to write your own Map? You can read about Maps in the Java® Tutorials. A Map does not usually have a predefined size, but enlarges as it is filled.


Thanks for Your Help

 
ted luton
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Welcome to the Ranch

It sounds like a kind of Map to me. Would you know how to write your own Map? You can read about Maps in the Java® Tutorials. A Map does not usually have a predefined size, but enlarges as it is filled.


In regards to a Symbol Table, How is that defined in Java?
 
Junilu Lacar
Sheriff
Posts: 11477
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you cite where you found this reference to a symbol table? This term is usually associated with compilers; it's basically a lookup table of all the different symbols encountered as the program source is parsed. For example, class names, variable names, method names, etc. are all symbols that will be added to a symbol table as your program is compiled. This is why you may get an error message that says "Can't resolve symbol x" when your code references a name that is not defined in the current scope.
 
ted luton
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junilu Lacar wrote:Can you cite where you found this reference to a symbol table? This term is usually associated with compilers; it's basically a lookup table of all the different symbols encountered as the program source is parsed. For example, class names, variable names, method names, etc. are all symbols that will be added to a symbol table as your program is compiled. This is why you may get an error message that says "Can't resolve symbol x" when your code references a name that is not defined in the current scope.


Sorry I cannot Ive lost the source

Do you have any resources in regards to formatting a symbol table in Java?
 
Junilu Lacar
Sheriff
Posts: 11477
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, unless you can come up with a precise definition of what you mean by a "symbol table" there is not much anyone can tell you with any degree of certainty. Sorry, but you have to TellTheDetails.
 
ted luton
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junilu Lacar wrote:Well, unless you can come up with a precise definition of what you mean by a "symbol table" there is not much anyone can tell you with any degree of certainty. Sorry, but you have to TellTheDetails.


What would a example look like in the compiler definition?
 
Junilu Lacar
Sheriff
Posts: 11477
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sure a quick search on Google would turn something up.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!