Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Parse code into object structures.

Is there a way to parse code into objects? What type of library would I use for this? I figured a syntax highlighter might be a good start.

Is anyone familiar with a lot of different languages? I'm trying to generalize their definitions into one structural markup language.
(Jan 24, 2017 08:13 AM)BorgEntomon Wrote:  Is there a way to parse code into objects? What type of library would I use for this? I figured a syntax highlighter might be a good start.

Is anyone familiar with a lot of different languages? I'm trying to generalize their definitions into one structural markup language.

I have no idea what this means - parse code into objects.

Do you mean source code? Binary code? Byte code?
Source code

For exampled the text "function Work(param1,param2){line1(); line2(); line3();}"
when put into the parser should return an object. Let's say it would return a "functionBlock" type of object. and that object would have a name. the params. potentially the types paired with those params* an array of statements. Mathematical operators would be classified the same as regular functions.


*not all languages demand that the param type be defined. Figuring out how to deal with syntax disagreements will be another issue I'll have tackle. As well as variable scope management.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by Z3R00NDATApr 3, 2024 04:17 AM 6 277 Apr 3, 2024 04:17 AM
Last Post: siliconvalley
[Perl] by ClumsyOct 8, 2022 10:20 AM 0 131 Oct 8, 2022 10:20 AM
Last Post: Clumsy
by ZencoJul 12, 2020 10:06 PM 4 114 Jul 12, 2020 10:06 PM
Last Post: OBAMASELF