Enhanced C#
Language of your choice: library documentation
Properties | List of all members
Loyc.Syntax.ILNodePrinterOptions Interface Reference

A set of relatively universal printing options that LNodePrinters should understand. More...


Source file:
Inheritance diagram for Loyc.Syntax.ILNodePrinterOptions:
Loyc.Syntax.LNodePrinterOptions Loyc.Ecs.EcsPrinterOptions Loyc.Syntax.Les.Les2PrinterOptions Loyc.Syntax.Les.Les3PrinterOptions

Remarks

A set of relatively universal printing options that LNodePrinters should understand.

See also
LNodePrinterOptions

Properties

bool AllowChangeParentheses [get]
 Indicates that it is preferable to add (or remove) parenthesis to produce good-looking output, rather than to express faithfully whether or not parentheses were present in the Loyc tree being printed. More...
 
bool OmitComments [get]
 When this flag is set, comment trivia attributes are suppressed (e.g. CodeSymbols.TriviaSLCommentAfter). More...
 
bool OmitUnknownTrivia [get]
 Causes trivia that the printer does not recognize (other than comments, spaces and raw text) to be dropped from the output rather than printed as attributes. More...
 
bool PrintTriviaExplicitly [get]
 If supported by the printer, this option causes comments and spaces to be printed as attributes in order to ensure faithful round-trip parsing. More...
 
bool CompatibilityMode [get]
 If there are multiple ways to print a given node, this option indicates that the printer should prefer an older, more compatible syntactic style over new ones, where applicable. More...
 
bool CompactMode [get]
 When this flag is set, the amount of whitespace in the output is reduced in a printer-defined way, in order to save bits. More...
 
string IndentString [get]
 Specifies the string to use for each level of indentation of nested constructs in the language, e.g. a tab or four spaces. More...
 
string NewlineString [get]
 Specifies the string to use for line breaks (typically "\n"). More...
 

Property Documentation

bool Loyc.Syntax.ILNodePrinterOptions.AllowChangeParentheses
get

Indicates that it is preferable to add (or remove) parenthesis to produce good-looking output, rather than to express faithfully whether or not parentheses were present in the Loyc tree being printed.

For example, the Loyc tree x * +(a, b) (LESv3 notation) will be printed x * (a + b), which is a slightly different tree (the parenthesis add the trivia attribute #trivia_inParens.)

bool Loyc.Syntax.ILNodePrinterOptions.CompactMode
get

When this flag is set, the amount of whitespace in the output is reduced in a printer-defined way, in order to save bits.

This option should not suppress newlines, indents or trivia. To suppress newlines or indents, the user can use empty strings for IndentString and NewlineString.

bool Loyc.Syntax.ILNodePrinterOptions.CompatibilityMode
get

If there are multiple ways to print a given node, this option indicates that the printer should prefer an older, more compatible syntactic style over new ones, where applicable.

For example, it tells the EC# printer to use C# printing mode. This option does not prevent printing of new constructs if such are present in the code, however.

string Loyc.Syntax.ILNodePrinterOptions.IndentString
get

Specifies the string to use for each level of indentation of nested constructs in the language, e.g. a tab or four spaces.

If this option is null, the printer should use its default indent string.

Indentation-sensitive languages should treat an empty string the same as null.

string Loyc.Syntax.ILNodePrinterOptions.NewlineString
get

Specifies the string to use for line breaks (typically "\n").

If this option is null, the printer should use its default newline string, which is almost always "\n".

Newline-sensitive languages should treat an empty string the same as null.

This string may or may not be used for line breaks inside multiline strings, depending on how strings are defined in the language being printed.

Referenced by Loyc.Syntax.LNodePrinter.PrintMultiple().

bool Loyc.Syntax.ILNodePrinterOptions.OmitComments
get

When this flag is set, comment trivia attributes are suppressed (e.g. CodeSymbols.TriviaSLCommentAfter).

bool Loyc.Syntax.ILNodePrinterOptions.OmitUnknownTrivia
get

Causes trivia that the printer does not recognize (other than comments, spaces and raw text) to be dropped from the output rather than printed as attributes.

Note: Some printers may force all unknown trivia to be dropped.

bool Loyc.Syntax.ILNodePrinterOptions.PrintTriviaExplicitly
get

If supported by the printer, this option causes comments and spaces to be printed as attributes in order to ensure faithful round-trip parsing.

Note: Some printers may ignore OmitUnknownTrivia, and OmitComments when this flag is true.