Thread: [cedet-semantic] Difficult to get haXe support
Brought to you by:
zappo
From: Nathan H. <ce...@lo...> - 2008-12-14 11:28:53
|
Hi, I wonder if it is difficult to get haXe support into cedet. I read the lang-support-guide.texi, but I do not get smart from it. I wonder: Since a compiler exists for haXe, there has to be some sort of grammer definition for it? Could this not be used by semantic? Greetings, Nathan |
From: Eric M. L. <er...@si...> - 2008-12-14 13:24:54
|
>>> Nathan Huesken <ce...@lo...> seems to think that: >Hi, > >I wonder if it is difficult to get haXe support into cedet. >I read the lang-support-guide.texi, but I do not get smart from it. > >I wonder: > >Since a compiler exists for haXe, there has to be some sort of grammer >definition for it? > >Could this not be used by semantic? [ ... ] Hi, I'm not sure what haXe is other than what it says on the website, but there are a couple ways to get Semantic support for it. You could write a grammar for it with wisent. This would be similar to working with lex/yacc. This would be like the java parser. It is fast, does incremental parsing, and has good support. If there is a haXe yacc file, you can usually convert these to wisent by removing the C code, and replacing it with Emacs Lisp code. You could write a regexp parser for it. This would just use Emacs regular expression matching. It doesn't support incremental parsing, and can be slower for big files, but fast to get the first implementation working. This is like the texinfo parser. You could use the haXe compiler to spit out some sort of definition list. This would be similar to the ctags parser (in CVS only in semantic/ctags.) Since haXe seems to be targetable to multiple languages, it could spit out Emacs Lisp code of various sorts. I think a real haXe hacker would write a "target" for it to spit out CTags, GTags, or Semantic tags. That would be pretty cool. Good Luck Eric -- Eric Ludlam: er...@si... Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net |
From: Nathan H. <ce...@lo...> - 2008-12-17 11:27:20
|
Hi, OK, I got it. I can now (learn to) write an back-end for haXe. No I only need to know how the target shoul look. CTags? Is there some defintion of how they look? Thanks! Nathan On Tue, Dec 16, 2008 at 09:18:28AM -0500, Eric M. Ludlam wrote: > Hi, > > You will need both. If you create a grammar for wisent, you will > need to make a lexer and a parser. A "lex" style lexer does not > translate directly into Semantic. You may be able to use all the > canned lexer parts available in semantic-lex, and you may need to make > some custom analyzers too. A key component to a Semantic lexer is to > make sure it can identify code blocks as a single block. That way you > don't have to parse the whole file, and things run faster. > > The grammar can often be converted as described below. > > It may also be worth asking on the haXe mailing list if a tagging > back-end could be added easily. That might be a simpler project. > > Eric > > >>> Nathan Huesken <ce...@lo...> seems to think that: > >Hi, > > > >The haXe package includes a lexer and a parser. > >I do not know enough about compiler to know which would produce the tokens needed for semantic. > >At which should I have a closer look, the lexer or the parser? > > > >THanks > >Nathan > > > >On Sun, Dec 14, 2008 at 08:24:50AM -0500, Eric M. Ludlam wrote: > >> >>> Nathan Huesken <ce...@lo...> seems to think that: > >> >Hi, > >> > > >> >I wonder if it is difficult to get haXe support into cedet. > >> >I read the lang-support-guide.texi, but I do not get smart from it. > >> > > >> >I wonder: > >> > > >> >Since a compiler exists for haXe, there has to be some sort of grammer > >> >definition for it? > >> > > >> >Could this not be used by semantic? > >> [ ... ] > >> > >> Hi, > >> > >> I'm not sure what haXe is other than what it says on the website, > >> but there are a couple ways to get Semantic support for it. > >> > >> You could write a grammar for it with wisent. This would be similar > >> to working with lex/yacc. This would be like the java parser. It is > >> fast, does incremental parsing, and has good support. If there is a > >> haXe yacc file, you can usually convert these to wisent by removing > >> the C code, and replacing it with Emacs Lisp code. > >> > >> You could write a regexp parser for it. This would just use Emacs > >> regular expression matching. It doesn't support incremental parsing, > >> and can be slower for big files, but fast to get the first > >> implementation working. This is like the texinfo parser. > >> > >> You could use the haXe compiler to spit out some sort of definition > >> list. This would be similar to the ctags parser (in CVS only in > >> semantic/ctags.) Since haXe seems to be targetable to multiple > >> languages, it could spit out Emacs Lisp code of various sorts. > >> > >> I think a real haXe hacker would write a "target" for it to spit out > >> CTags, GTags, or Semantic tags. That would be pretty cool. > >> > >> Good Luck > >> Eric > >> > >> -- > >> Eric Ludlam: er...@si... > >> Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net > > > > -- > Eric Ludlam: er...@si... > Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net -- ______________________________________ / "Another world, another day, another \ \ dawn. " / -------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || |
From: Eric M. L. <er...@si...> - 2008-12-17 12:04:27
|
The definition for how a semantic tag table should look is in the semantic appdev manual, in the first node called "Semantic Tags." Hopefully that will help you through. Eric >>> Nathan Huesken <ce...@lo...> seems to think that: >Hi, >OK, I got it. I can now (learn to) write an back-end for haXe. >No I only need to know how the target shoul look. >CTags? Is there some defintion of how they look? > >Thanks! >Nathan > > >On Tue, Dec 16, 2008 at 09:18:28AM -0500, Eric M. Ludlam wrote: >> Hi, >> >> You will need both. If you create a grammar for wisent, you will >> need to make a lexer and a parser. A "lex" style lexer does not >> translate directly into Semantic. You may be able to use all the >> canned lexer parts available in semantic-lex, and you may need to make >> some custom analyzers too. A key component to a Semantic lexer is to >> make sure it can identify code blocks as a single block. That way you >> don't have to parse the whole file, and things run faster. >> >> The grammar can often be converted as described below. >> >> It may also be worth asking on the haXe mailing list if a tagging >> back-end could be added easily. That might be a simpler project. >> >> Eric >> >> >>> Nathan Huesken <ce...@lo...> seems to think that: >> >Hi, >> > >> >The haXe package includes a lexer and a parser. >> >I do not know enough about compiler to know which would produce the tokens needed for semantic. >> >At which should I have a closer look, the lexer or the parser? >> > >> >THanks >> >Nathan >> > >> >On Sun, Dec 14, 2008 at 08:24:50AM -0500, Eric M. Ludlam wrote: >> >> >>> Nathan Huesken <ce...@lo...> seems to think that: >> >> >Hi, >> >> > >> >> >I wonder if it is difficult to get haXe support into cedet. >> >> >I read the lang-support-guide.texi, but I do not get smart from it. >> >> > >> >> >I wonder: >> >> > >> >> >Since a compiler exists for haXe, there has to be some sort of grammer >> >> >definition for it? >> >> > >> >> >Could this not be used by semantic? >> >> [ ... ] >> >> >> >> Hi, >> >> >> >> I'm not sure what haXe is other than what it says on the website, >> >> but there are a couple ways to get Semantic support for it. >> >> >> >> You could write a grammar for it with wisent. This would be similar >> >> to working with lex/yacc. This would be like the java parser. It is >> >> fast, does incremental parsing, and has good support. If there is a >> >> haXe yacc file, you can usually convert these to wisent by removing >> >> the C code, and replacing it with Emacs Lisp code. >> >> >> >> You could write a regexp parser for it. This would just use Emacs >> >> regular expression matching. It doesn't support incremental parsing, >> >> and can be slower for big files, but fast to get the first >> >> implementation working. This is like the texinfo parser. >> >> >> >> You could use the haXe compiler to spit out some sort of definition >> >> list. This would be similar to the ctags parser (in CVS only in >> >> semantic/ctags.) Since haXe seems to be targetable to multiple >> >> languages, it could spit out Emacs Lisp code of various sorts. >> >> >> >> I think a real haXe hacker would write a "target" for it to spit out >> >> CTags, GTags, or Semantic tags. That would be pretty cool. >> >> >> >> Good Luck >> >> Eric >> >> >> >> -- >> >> Eric Ludlam: er...@si... >> >> Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net >> > >> >> -- >> Eric Ludlam: er...@si... >> Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net > -- Eric Ludlam: er...@si... Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net |