Hi, I’m new to this forum. I was attracted by a headline (see topic) while seeking for a way to translate C code to JavaScript.
Reason behind: I have written a lexer using Flex/Lex (ancient unix tool for language parsing). This lexer works on web contents, so to say the text body of a web page.
At the moment the program works as a CGI C program fetching (http-fetch) the page and processing it. This doesn’t work on pages that are dynamically generated out of CMS systems or databases. Anyway, the idea is to translate it into JS and having JS process the Document contents in the page.
Yes, it is ancient in the manner that C is ancient.
That is unclear. Is it all the contents? Or is it specific areas and/or types of content? If it is all the contents then I assume it is parsing the language. That is typically called Natural Language Processing. If not that then it is not clear what the input is but perhaps it is not relevant.
I do not understand that either. If you are capturing HTML using the first DocumentComplete or something like that then yes JavaScript in the page can insert additional HTML. Perhaps you just need to know how to capture the content after all that has been done. It is something that experts here are very familiar with. Perhaps you need to be asking for help with that.
I totally do not understand how you are trying to use Emscripten. Are you trying to convert the C code generated by Flex to JavaScript and use that to dynamically process … oh my poor head is spinning too much, I cannot figure out what you are trying to do.
@SamuelCalifornia: Your questions are justified. I don’t recall today exactly what the limitations were when I put the project aside last time I worked on it. But the essence was to better put the lex program in the script portion and have it executed on the DOM. I assume there is something like the pure text that is in a page in DOM.
Narrow it down to something like translating the contents of a page from one language into another.
And to further boil down the problem and that’s why I think EMSCRIPTEN could be a way: take the C-program (https://github.com/westes/flex) and translate it into JS.