Enhanced C#
Language of your choice: library documentation
Public fields | Properties | Public Member Functions | List of all members
Loyc.Syntax.Les.Les2PrinterOptions Class Reference

Options to control the way Loyc trees are printed by Les2Printer. More...


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

Remarks

Options to control the way Loyc trees are printed by Les2Printer.

Public fields

bool SpacesBetweenAppendedStatements = true
 Whether to add a space between multiple statements printed on one line (initial value: true). More...
 
int SpaceAroundInfixStopPrecedence = LesPrecedence.Multiply.Hi + 1
 The printer avoids printing spaces around infix (binary) operators that have the specified precedence or higher. More...
 
int SpaceAfterPrefixStopPrecedence = LesPrecedence.Multiply.Hi + 1
 The printer avoids printing spaces after prefix operators that have the specified precedence or higher. More...
 

Properties

override bool AllowChangeParentheses [get, set]
 Introduces extra parenthesis to express precedence, without using an empty attribute list [] to allow perfect round-tripping. More...
 
override bool PrintTriviaExplicitly [get, set]
 Causes comments and spaces to be printed as attributes in order to ensure faithful round-trip parsing. By default, only "raw text" and unrecognized trivia is printed this way. Note: inParens is always printed as parentheses, and ILNodePrinterOptions.OmitUnknownTrivia has no effect when this flag is true. More...
 
bool OmitMissingArguments [get, set]
 When an argument to a method or macro has the value @``, it will be omitted completely if this flag is set. More...
 
bool OmitSpaceTrivia [get, set]
 When this flag is set, space trivia attributes are ignored (e.g. CodeSymbols.TriviaNewline). More...
 
override bool CompactMode [get, set]
 
bool QuoteUnprintableLiterals [get, set]
 When the printer encounters an unprintable literal, it calls Value.ToString(). When this flag is set, the string is placed in double quotes; when this flag is clear, it is printed as raw text. More...
 
bool ObeyRawText [get, set]
 Causes raw text to be printed verbatim, as the EC# printer does. When this option is false, raw text trivia is printed as a normal attribute. More...
 
- Properties inherited from Loyc.Syntax.LNodePrinterOptions
virtual bool AllowChangeParentheses [get, set]
 
virtual bool OmitComments [get, set]
 
virtual bool OmitUnknownTrivia [get, set]
 
virtual bool PrintTriviaExplicitly [get, set]
 
virtual bool CompatibilityMode [get, set]
 
virtual bool CompactMode [get, set]
 
virtual string IndentString [get, set]
 
virtual string NewlineString [get, set]
 
virtual ILiteralPrinter LiteralPrinter [get, set]
 
- Properties inherited from Loyc.Syntax.ILNodePrinterOptions
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...
 
ILiteralPrinter LiteralPrinter [get]
 Requests that a specific printer be used to convert literals into strings. More...
 

Public Member Functions

 Les2PrinterOptions (ILNodePrinterOptions options)
 
- Public Member Functions inherited from Loyc.Syntax.LNodePrinterOptions
void CopyFrom (ILNodePrinterOptions original)
 

Member Data Documentation

◆ SpaceAfterPrefixStopPrecedence

int Loyc.Syntax.Les.Les2PrinterOptions.SpaceAfterPrefixStopPrecedence = LesPrecedence.Multiply.Hi + 1

The printer avoids printing spaces after prefix operators that have the specified precedence or higher.

◆ SpaceAroundInfixStopPrecedence

int Loyc.Syntax.Les.Les2PrinterOptions.SpaceAroundInfixStopPrecedence = LesPrecedence.Multiply.Hi + 1

The printer avoids printing spaces around infix (binary) operators that have the specified precedence or higher.

See also
LesPrecedence

◆ SpacesBetweenAppendedStatements

bool Loyc.Syntax.Les.Les2PrinterOptions.SpacesBetweenAppendedStatements = true

Whether to add a space between multiple statements printed on one line (initial value: true).

Property Documentation

◆ AllowChangeParentheses

override bool Loyc.Syntax.Les.Les2PrinterOptions.AllowChangeParentheses
getset

Introduces extra parenthesis to express precedence, without using an empty attribute list [] to allow perfect round-tripping.

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

◆ ObeyRawText

bool Loyc.Syntax.Les.Les2PrinterOptions.ObeyRawText
getset

Causes raw text to be printed verbatim, as the EC# printer does. When this option is false, raw text trivia is printed as a normal attribute.

◆ OmitMissingArguments

bool Loyc.Syntax.Les.Les2PrinterOptions.OmitMissingArguments
getset

When an argument to a method or macro has the value @``, it will be omitted completely if this flag is set.

◆ OmitSpaceTrivia

bool Loyc.Syntax.Les.Les2PrinterOptions.OmitSpaceTrivia
getset

When this flag is set, space trivia attributes are ignored (e.g. CodeSymbols.TriviaNewline).

◆ PrintTriviaExplicitly

override bool Loyc.Syntax.Les.Les2PrinterOptions.PrintTriviaExplicitly
getset

Causes comments and spaces to be printed as attributes in order to ensure faithful round-trip parsing. By default, only "raw text" and unrecognized trivia is printed this way. Note: inParens is always printed as parentheses, and ILNodePrinterOptions.OmitUnknownTrivia has no effect when this flag is true.

◆ QuoteUnprintableLiterals

bool Loyc.Syntax.Les.Les2PrinterOptions.QuoteUnprintableLiterals
getset

When the printer encounters an unprintable literal, it calls Value.ToString(). When this flag is set, the string is placed in double quotes; when this flag is clear, it is printed as raw text.