Questions tagged [concrete-syntax-tree]

Concrete syntax tree is intended for questions related to syntax analysis necessary for automated source code refactoring or syntax analysis tool development.

A concrete syntax tree is a hierarchical representation of the syntax of a language which is generated by parsing tokens based on a grammar definition.

References

19 questions
0
votes
0 answers

How to pretty print source code when using a AST that is generated from a CST

I'm aware that its fairly trivial to pretty print code with a CST, since information about the grammar is stored in the node. However, when converted to a AST, much of the initial structure of the source code is lost from de sugaring and other…
0
votes
1 answer

OCL : from AST to concrete syntax

Evrything is in the title : I have an OCL AST (with as root an org.eclipse.ocl.ecore.Constraint) which I have modified. I would like to parse it again, but I only find the "one-line OCL grammar" that you get when printing a constraint (or any OCL…
0
votes
1 answer

How can I contruct a `X?` concrete syntax value?

I have this concrete syntax: syntax SomeMore = [...] SyncBlock? sync; syntax SyncBlock = "sync" "{" SyncStatement* stats "}"; syntax SyncStatement = [...]; [SyncBlock]"sync { }" seems to work, but when I try to use it as a SyncBlock?…
Tim
  • 221
  • 3
  • 12
-2
votes
1 answer

Is it humanly possible to fix indent size issues w/o access to a syntax tree?

Asked another way, if I showed you this masked code file, using only your human brain, is it possible to fix the indentation issues, even if you know it should be 2-space indentation? …
1
2