Hi Laurent I think much of the parser, such as the JFlex lexer is certainly reusable. The recursive descent parser outputs Intellij objects, but with pretty minor changes could be made reuseable.
Please feel free to take anything you want. http://code.google.com/p/clojure-intellij-plugin/source/browse/ lpetit wrote: > Hello Peter, > > As I understand, you've made what I also began to make for clojuredev > (clojure dev environment for eclipse me and other folks are working on > on our spare time) : a static source code parser. Mine is currently > not very tested (and maybe not very usefull as is, because it has not > yet be faced to real-world problem). > > Do you think it could be possible to reuse your parser for the needs > of clojuredev , or is it too tied to the intelliJ framework/ > infrastructure ? > > Thanks in advance, > > -- > Laurent > > On Jan 17, 2:40 pm, Peter Wolf <opus...@gmail.com> wrote: > >> Actually, the observation below might be really good news. Does it >> means that all references are resolved at compile time? Do I ever have >> to run the code to figure out the context of a reference? Or, does the >> lexical context give me all the information I need? >> >> I have already reimplemented the Clojure parser to do the syntax >> checking, folding and brace matching. Reimplementing references might >> not be so bad. >> >> In brief, I parse the Clojure program into a tree structure (of >> course). Defs, defns, lets etc are all nodes on this tree. Symbols are >> leafs. The nodes in the tree are sorted by the order the text appeared >> in the file. Used code from other files is treated as being textually >> inserted. >> >> Can I always resolve a reference by walking back up the tree. Walk back >> at the current level, if not found, go up a level and walk back, repeat. >> >> Thanks >> P >> >> >>> Remember, Clojure is a compiler, not an interpreter. The compiler >>> doesn't remember syntax. There is no "running image" in the Smalltalk >>> sense. >>> >>> So the 100% perfect refactoring you have in mind may not be possible >>> without reimplementing a large portion of Clojure itself. >>> >>> -Stuart Sierra >>> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---