Enhanced C#
Language of your choice: library documentation
Public Member Functions | List of all members
Loyc.Syntax.ILNodePrinter Interface Reference

This interface allows serializing LNode objects into the syntax of a particular programming language. More...


Source file:
Inheritance diagram for Loyc.Syntax.ILNodePrinter:
Loyc.Ecs.EcsLanguageService Loyc.Syntax.Les.Les2LanguageService Loyc.Syntax.Les.Les3LanguageService Loyc.Syntax.Les.LesLanguageService

Remarks

This interface allows serializing LNode objects into the syntax of a particular programming language.

The ToString() method of an object that implements this interface should return the name of the programming language that it is able to print.

Public Member Functions

void Print (LNode node, StringBuilder target, IMessageSink sink=null, ParsingMode mode=null, ILNodePrinterOptions options=null)
 Serializes the specified syntax tree to a StringBuilder in the syntax supported by this object. More...
 
void Print (IEnumerable< LNode > nodes, StringBuilder target, IMessageSink sink=null, ParsingMode mode=null, ILNodePrinterOptions options=null)
 Serializes a list of syntax trees to a StringBuilder in the syntax supported by this object. More...
 

Member Function Documentation

◆ Print() [1/2]

void Loyc.Syntax.ILNodePrinter.Print ( IEnumerable< LNode nodes,
StringBuilder  target,
IMessageSink  sink = null,
ParsingMode  mode = null,
ILNodePrinterOptions  options = null 
)

Serializes a list of syntax trees to a StringBuilder in the syntax supported by this object.

Parameters
nodesSyntax trees to print.
targetAn output buffer, to which output is appended.
sinkAn object used to print warning and error messages. If this is null, messages are sent to MessageSink.Default.
modeIndicates the context in which the node(s) to be printed should be understood (e.g. is it a statement or an expression?).
optionsA set of options to control printer behavior. If null, an appropriate default set of options should be used. Some languages may support additional option interfaces beyond ILNodePrinterOptions.

Some implementations can simply call LNodePrinter.PrintMultiple.

Implemented in Loyc.Ecs.EcsLanguageService, and Loyc.Syntax.Les.Les2LanguageService.

◆ Print() [2/2]

void Loyc.Syntax.ILNodePrinter.Print ( LNode  node,
StringBuilder  target,
IMessageSink  sink = null,
ParsingMode  mode = null,
ILNodePrinterOptions  options = null 
)

Serializes the specified syntax tree to a StringBuilder in the syntax supported by this object.

Parameters
nodeA syntax tree to print.
targetAn output buffer, to which output is appended.
sinkAn object used to print warning and error messages. If this is null, messages are sent to MessageSink.Default.
modeIndicates the context in which the node(s) to be printed should be understood (e.g. is it a statement or an expression?).
optionsA set of options to control printer behavior. If null, an appropriate default set of options should be used. Some languages may support additional option interfaces beyond ILNodePrinterOptions.

Implemented in Loyc.Ecs.EcsLanguageService.

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