Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AST vs CST #4

Open
jayvdb opened this issue Sep 14, 2016 · 4 comments
Open

AST vs CST #4

jayvdb opened this issue Sep 14, 2016 · 4 comments

Comments

@jayvdb
Copy link
Member

jayvdb commented Sep 14, 2016

It is hard to auto-fix code if you only have an AST. Vital information has been dropped.
Also many of the generic bears rely on information typically not present in an AST.

Do you actually want a universal CST also?

@sils
Copy link
Member

sils commented Sep 14, 2016

I haven't thought about all this in detail, my idea was to have the AST while keeping the information which part belongs where in the source code so we could reorder the statements. I'm not fully aware about the difference between AST and CST though. Apparently people at our university don't think a master student in computer science should know that :P

@sils
Copy link
Member

sils commented Sep 14, 2016

(First step and most important is analysis, auto fix is more of a very very super cool gimmick after I think.)

@Makman2
Copy link
Member

Makman2 commented Sep 14, 2016

I think we should focus on ASTs as they are a bit easier. Though what we could do already is assigning each AST element the according code-string. Like

// inside a C file:
return a + 2;

-->

Return, range=(0, 13), text='return a + 2;'
 - Add, range=(7, 12), text='a + 2'
   - Variable, name = 'a', range=(7,8), text='a'
   - Constant, value = '2', range=(11, 12), text = '2'

then we are not discarding additional information. We just don't parse it :)

@Makman2
Copy link
Member

Makman2 commented Sep 14, 2016

so agreeing with @sils1297 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants