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

Source file:
Inheritance diagram for Loyc.Syntax.Les.Les3Printer:
Loyc.Syntax.Les.Les3PrettyPrinter

Properties

StringBuilder SB [get, set]
 
IMessageSink MessageSink [get, set]
 Target for warning messages. More...
 
Les3PrinterOptions Options [get]
 

Public Member Functions

void SetOptions (ILNodePrinterOptions options)
 
StringBuilder Print (ILNode node, string suffix=null)
 
override string ToString ()
 
void VisitId (ILNode node)
 
void PrintIdCore (Symbol name, bool startToken, bool forceQuote=false)
 
void VisitLiteral (ILNode node)
 
void VisitCall (ILNode node)
 

Static Public Member Functions

static bool IsNormalIdentifier (Symbol name)
 

Protected Types

enum  Chars {
  Delimiter = 0, IdStart = 1, SingleQuote = 2,
  Id = IdStart | SingleQuote, Punc = 4, Minus = 8,
  Dot = 16, NumberStart = IdStart | Minus | Dot, NegativeNumberStart = Punc | Minus,
  NumberEnd = Id | BQId | Dot, IdAndPunc = Id | Punc | Minus | Dot, DoubleQuote = 32,
  BQId = 64, StringStart = DoubleQuote | Id | BQId, At = 128,
  Space = 256, SLComment = 512
}
 Based on these flags, StartToken() and WriteToken() ensure that two adjacent tokens aren't treated like a single token when reparsed, by printing a space between them if necessary. More...
 
enum  NewlineContext {
  NewlineUnsafe = 0, NewlineSafeAfter = 1, NewlineSafeBefore = 2,
  AfterBinOp = 4, StatementLevel = NewlineSafeBefore | NewlineSafeAfter, AutoDetect = 8
}
 Used to help keep track of where newline trivia (and single- line comments ending in a newline) are permitted, to avoid printing newline trivia where it would count as "end of expression". More...
 

Protected Member Functions

void Print (ILNode node, Precedence context, string suffix=null, NewlineContext nlContext=NewlineContext.AutoDetect)
 
void PrintCore (ILNode node, string suffix)
 
void WriteToken (char firstChar, LesColorCode kind, Chars tokenSet)
 
void WriteToken (string text, LesColorCode kind, Chars tokenSet)
 
void WriteToken (string text, LesColorCode kind, Chars startSet, Chars endSet)
 
void StartToken (LesColorCode kind, Chars charSet)
 
void StartToken (LesColorCode kind, Chars startSet, Chars endSet)
 
virtual void StartToken (LesColorCode kind)
 
void WriteOutsideToken (char space)
 
void Newline (bool avoidExtraNewline=false)
 
void Space (bool condition=true)
 
virtual LesColorCode ColorCodeForId (Symbol name)
 

Protected fields

PrinterState PS
 
ILNode _n
 
Precedence _context = Precedence.MinValue
 
NewlineContext _nlContext = NewlineContext.NewlineUnsafe
 
Chars _curSet = 0
 
bool _allowBlockCalls = true
 
bool _inParensOrBracks = false
 
bool _isOneLiner = false
 Indicates whether the NodeStyle.OneLiner flag is present on the current node or any of its parents. It suppresses newlines within braced blocks. More...
 

Protected static fields

static Symbol _s = GSymbol.Get("s")
 
static Symbol _F = GSymbol.Get("f")
 
static Symbol _D = GSymbol.Get("d")
 
static Symbol _M = GSymbol.Get("m")
 
static Symbol _U = GSymbol.Get("u")
 
static Symbol _L = GSymbol.Get("L")
 
static Symbol _UL = GSymbol.Get("uL")
 
static Symbol _Z = GSymbol.Get("z")
 
static Symbol _number = GSymbol.Get("number")
 

Member Enumeration Documentation

enum Loyc.Syntax.Les.Les3Printer.Chars
strongprotected

Based on these flags, StartToken() and WriteToken() ensure that two adjacent tokens aren't treated like a single token when reparsed, by printing a space between them if necessary.

Used to help keep track of where newline trivia (and single- line comments ending in a newline) are permitted, to avoid printing newline trivia where it would count as "end of expression".

Member Data Documentation

bool Loyc.Syntax.Les.Les3Printer._isOneLiner = false
protected

Indicates whether the NodeStyle.OneLiner flag is present on the current node or any of its parents. It suppresses newlines within braced blocks.

Property Documentation

IMessageSink Loyc.Syntax.Les.Les3Printer.MessageSink
getset

Target for warning messages.