Click or drag to resize

JsonGenerator Class

Generates JSON from Syntactik DOM.
Inheritance Hierarchy

Namespace:  Syntactik.Compiler.Generator
Assembly:  Syntactik (in Syntactik.dll) Version: 0.3.0-beta1
Syntax
C#
public class JsonGenerator : AliasResolvingVisitor

The JsonGenerator type exposes the following members.

Constructors
  NameDescription
Public methodJsonGenerator
This constructor should be used if output depends on the name of the document.
Top
Properties
  NameDescription
Protected propertyAliasContext
Keeps track of nested aliases.
(Inherited from AliasResolvingVisitor.)
Protected propertyContext
Provides access to CompilerContext.
(Inherited from AliasResolvingVisitor.)
Protected propertyCurrentDocument
Property is used to keep track of current visiting Document.
(Inherited from AliasResolvingVisitor.)
Protected propertyScopeContext
Keeps track of nested namespace scopes.
(Inherited from AliasResolvingVisitor.)
Top
Methods
  NameDescription
Protected methodCheckBlockStartForAlias
Starts array if the value alias is first item in the array
Protected methodEnterChoiceContainer
Tries to resolve a pair as a choice.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnPair
Method is wrapping call to Accept method of every node.
(Inherited from SyntactikDepthFirstVisitor.)
Public methodOnValue
Method called when the value of the current pair is resolved.
(Overrides AliasResolvingVisitorOnValue(String, ValueType).)
Protected methodResolveAttributes
Go through all entities and resolve attributes for the current node.
(Inherited from AliasResolvingVisitor.)
Protected methodResolveAttributesInAlias
Resolves attributes in Alias. Elements are ignored.
(Inherited from AliasResolvingVisitor.)
Protected methodResolveAttributesInParameter
Resolves attributes in Parameter. Elements are ignored.
(Inherited from AliasResolvingVisitor.)
Protected methodResolveChoiceValue
Method is called for pair with literal choice assignment =::.
(Overrides AliasResolvingVisitorResolveChoiceValue(Pair, ValueType).)
Protected methodResolveDqsEscape
Resolves escape sequence
(Inherited from AliasResolvingVisitor.)
Protected methodResolveDqsEscapeChar
Converts EscapeMatch to Char.
(Inherited from AliasResolvingVisitor.)
Protected methodResolvePairValue
Resolves literal value of the pair.
(Inherited from AliasResolvingVisitor.)
Protected methodResolveValue
Resolves literal value of the Pair.
(Inherited from AliasResolvingVisitor.)
Protected methodResolveValueAlias
Resolves literal value of Alias.
(Inherited from AliasResolvingVisitor.)
Protected methodResolveValueParameter
Resolves value of the value parameter.
(Inherited from AliasResolvingVisitor.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodVisit(Alias)
Visit method for Alias.
(Overrides AliasResolvingVisitorVisit(Alias).)
Public methodVisit(AliasDefinition)
Visit method for AliasDefinition.
(Inherited from AliasResolvingVisitor.)
Public methodVisit(Argument)
Visit method for Argument.
(Inherited from SyntactikDepthFirstVisitor.)
Public methodVisit(Attribute)
Visit method for Attribute.
(Overrides SyntactikDepthFirstVisitorVisit(Attribute).)
Public methodVisit(Comment)
Visit method for Comment.
(Inherited from SyntactikDepthFirstVisitor.)
Public methodVisit(CompileUnit)
Visit method for CompileUnit.
(Inherited from SyntactikDepthFirstVisitor.)
Public methodVisit(Document)
Visit method for Document.
(Overrides SyntactikDepthFirstVisitorVisit(Document).)
Public methodVisit(Element)
Visit method for Element.
(Overrides AliasResolvingVisitorVisit(Element).)
Public methodVisit(Module)
Visit method for Module.
(Overrides SyntactikDepthFirstVisitorVisit(Module).)
Public methodVisit(NamespaceDefinition)
Visit method for NamespaceDefinition.
(Inherited from SyntactikDepthFirstVisitor.)
Public methodVisit(Pair)
Asks visitor to visit a pair.
(Inherited from SyntactikDepthFirstVisitor.)
Public methodVisit(Parameter)
Visit method for Parameter.
(Inherited from AliasResolvingVisitor.)
Public methodVisit(Scope)
Visit method for Scope.
(Inherited from AliasResolvingVisitor.)
Public methodVisitT(IEnumerableT)
Asks visitor to visit each pair in collection.
(Inherited from SyntactikDepthFirstVisitor.)
Top
Fields
  NameDescription
Protected fieldBlockIsStarting
If true then the current block state (object/array) is not defined.
Protected fieldBlockState
Stack storing states of blocks.
Protected fieldChoiceStack
Stack of ChoiceInfo.
Protected fieldJsonWriter
JsonWriter is used to generate JSON text.
Protected fieldNamespaceResolver
Provides access to services of NamespaceResolver.
(Inherited from AliasResolvingVisitor.)
Protected fieldWriterDelegate
Delegate is called to create JsonWriter for each Document.
Top
See Also