[silver:langutil:unparse]

Contents of [silver:langutil:unparse]:

Defined in this grammar:

function unparseFile   (Document ::= origText::String tree::a )

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 24.

Parameter origText
The original text of the file that was parsed to create the origin of tree.
Parameter tree
The concrete syntax tree to unparse.
Return
The unparse of the tree, with layout from origText inserted in unchanged portions of the tree.

Unparse a tree, preserving layout from its parse tree via origin tracking. The productions in the tree should only consist of nonterminal and terminal symbols; in a language with seperate concrete and abstract syntax, this may require defining a translation from abstract back to concrete syntax.

This is intended for use in e.g. refactoring tools, where transformations can be applied on the tree, but one would like to turn the tree back into a string without affecting layout in otherwise-unchanged portions of the tree.

Layout preceeding and following the root of the tree is included in the output.


function unparseFragment   (Document ::= origText::String tree::a )

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 55.

Parameter origText
The original text of the file that was parsed to create the origin of tree.
Parameter tree
The concrete syntax tree to unparse.
Return
The unparse of the tree, with layout from origText inserted in unchanged portions of the tree.

Like unparseFile, but intended for unparsing a tree corresponding to a fragment of a file. Layout preceeding and following the root of the tree is not included.

fun getParseTree   (AST ::= ast::a )

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 71.

(Undocumented.)


inherited attribute origText :: String

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 80.

(Undocumented.)


inherited attribute lineIndent :: map:Map<Integer Integer>

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 81.

(Undocumented.)


inherited attribute initialIndent :: Integer

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 82.

(Undocumented.)


synthesized attribute originLoc :: Location

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 85.

(Undocumented.)


synthesized attribute indent :: Integer

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 86.

(Undocumented.)


monoid attribute indents :: [Integer]

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 88.

(Undocumented.)


synthesized attribute isBox :: Boolean

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 91.

(Undocumented.)


synthesized attribute origNest :: Integer

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 92.

(Undocumented.)


synthesized attribute origLayoutPP :: Document

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 93.

(Undocumented.)


inherited attribute parseTree<a> :: Maybe<a>

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 96.

(Undocumented.)


synthesized attribute unparseWithLayout :: Document

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 100.

(Undocumented.)


synthesized attribute defaultPreLayout :: Maybe<Document>

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 101.

(Undocumented.)


synthesized attribute defaultPostLayout :: Maybe<Document>

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 102.

(Undocumented.)


inherited attribute childIndex :: Integer

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 103.

(Undocumented.)


inherited attribute childLayout :: [(Integer,Document)]

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 104.

(Undocumented.)


inherited attribute childIndent :: [(Integer,Integer)]

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 105.

(Undocumented.)


inherited attribute childGroup :: [(Integer,Integer)]

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 106.

(Undocumented.)


inherited attribute currentGroup :: Maybe<Integer>

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 109.

(Undocumented.)


synthesized attribute groupUnparse :: Document

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 110.

(Undocumented.)


aspect default production top::AST ::= {#aspect_default_production_silver:core:AST}

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 112.

(Undocumented.)


fun countIndent   (Integer ::= s::String )

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 283.

(Undocumented.)


fun layoutPP   (Document ::= indent::Integer layoutStr::String )

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 285.

(Undocumented.)


fun maybeNest   (Document ::= n::Integer d::Document )

Contained in grammar [silver:langutil:unparse]. Defined at silver/langutil/unparse/Unparse.sv line 297.

(Undocumented.)