sun::serialization::ASTDeserializer

sun::serialization::ASTDeserializer

class · Source (opens in a new tab)

class sun::serialization::ASTDeserializer

Deserialize protobuf messages to AST nodes.

Public Functions

ASTDeserializer

public · function · Source (opens in a new tab)

sun::serialization::ASTDeserializer::ASTDeserializer(DeserializerConfig config={})

Creates a syntax-tree decoder using the supplied deserialization settings.

Related: DeserializerConfig

deserialize

public · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserialize(const pbc::ASTNode &node) const

Deserialize any expression node.

Related: ExprAST

deserializeFromString

public · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeFromString(const std::string &data) const

Deserialize from bytes (convenience).

Related: ExprAST

deserializeProgram

public · function · Source (opens in a new tab)

std::unique_ptr< BlockExprAST > sun::serialization::ASTDeserializer::deserializeProgram(const pbc::Program &program) const

Deserialize a complete program.

Related: BlockExprAST

deserializeProgramFromString

public · function · Source (opens in a new tab)

std::unique_ptr< BlockExprAST > sun::serialization::ASTDeserializer::deserializeProgramFromString(const std::string &data) const

Reconstructs a program syntax tree from a protobuf byte string.

Related: BlockExprAST

deserializePrototype

public · function · Source (opens in a new tab)

std::unique_ptr< sun::ast::PrototypeAST > sun::serialization::ASTDeserializer::deserializePrototype(const pbc::Prototype &proto) const

Deserialize a prototype.

Related: sun::ast::PrototypeAST

Private Functions

deserializeArray

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeArray(const pbc::ArrayLiteral &proto) const

Reconstructs a array literal and its child nodes from protobuf data.

Related: ExprAST

deserializeArrayIndex

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeArrayIndex(const pbc::ArrayIndexExpr &proto) const

Reconstructs a array index and its child nodes from protobuf data.

Related: ExprAST

deserializeBinary

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeBinary(const pbc::BinaryExpr &proto) const

Reconstructs a binary operation and its child nodes from protobuf data.

Related: ExprAST

deserializeBlock

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeBlock(const pbc::BlockExpr &proto) const

Reconstructs a lexical block and its child nodes from protobuf data.

Related: ExprAST

deserializeBlockExpr

private · function · Source (opens in a new tab)

std::unique_ptr< BlockExprAST > sun::serialization::ASTDeserializer::deserializeBlockExpr(const pbc::BlockExpr &proto) const

Helper to deserialize a BlockExpr specifically.

Related: BlockExprAST

deserializeBool

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeBool(const pbc::BoolLiteral &proto) const

Reconstructs a boolean literal and its child nodes from protobuf data.

Related: ExprAST

deserializeCall

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeCall(const pbc::CallExpr &proto) const

Reconstructs a function call and its child nodes from protobuf data.

Related: ExprAST

deserializeCharLiteral

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeCharLiteral(const pbc::CharLiteral &proto) const

Reconstructs a character literal and its child nodes from protobuf data.

Related: ExprAST

deserializeClassDef

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeClassDef(const pbc::ClassDef &proto) const

Reconstructs a class declaration and its child nodes from protobuf data.

Related: ExprAST

deserializeCompoundAssignment

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeCompoundAssignment(const pbc::CompoundAssignment &proto) const

Reconstructs a compound assignment and its child nodes from protobuf data.

Related: ExprAST

deserializeConstantValue

private · function · Source (opens in a new tab)

sun::semantic_analysis::constants::ConstantValue sun::serialization::ASTDeserializer::deserializeConstantValue(const pbc::ConstantValue &proto) const

Reads a value a library computed for one of its globals.

The result has no types yet; analysis fills them in from the global's type.

Related: sun::semantic_analysis::constants::ConstantValue

deserializeDeclareType

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeDeclareType(const pbc::DeclareType &proto) const

Reconstructs a forward type declaration and its child nodes from protobuf data.

Related: ExprAST

deserializeEnumDef

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeEnumDef(const pbc::EnumDef &proto) const

Reconstructs a enum declaration and its child nodes from protobuf data.

Related: ExprAST

deserializeExprBase

private · function · Source (opens in a new tab)

void sun::serialization::ASTDeserializer::deserializeExprBase(const pbc::ASTNode &node, ExprAST *expr) const

Restore common ExprAST fields from the proto message.

Related: ExprAST, ExprAST

deserializeField

private · function · Source (opens in a new tab)

template <typename FieldDecl, typename FieldProto>
FieldDecl sun::serialization::ASTDeserializer::deserializeField(const FieldProto &proto) const

Class and interface fields are declared alike, so they load alike.

deserializeFor

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeFor(const pbc::ForExpr &proto) const

Reconstructs a for loop and its child nodes from protobuf data.

Related: ExprAST

deserializeForIn

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeForIn(const pbc::ForInExpr &proto) const

Reconstructs a iteration loop and its child nodes from protobuf data.

Related: ExprAST

deserializeFunction

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeFunction(const pbc::FunctionDef &proto) const

Reconstructs a function definition and its child nodes from protobuf data.

Related: ExprAST

deserializeGenericCall

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeGenericCall(const pbc::GenericCallExpr &proto) const

Reconstructs a generic function call and its child nodes from protobuf data.

Related: ExprAST

deserializeIdentity

private · function · Source (opens in a new tab)

void sun::serialization::ASTDeserializer::deserializeIdentity(const pbc::DeclarationIdentity &proto, sun::semantic_analysis::DeclarationIdentity &identity) const

Retain validated portable identities until the declaration pass interns them.

Related: sun::semantic_analysis::DeclarationIdentity

deserializeIf

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeIf(const pbc::IfExpr &proto) const

Reconstructs a conditional expression and its child nodes from protobuf data.

Related: ExprAST

deserializeIndex

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeIndex(const pbc::IndexExpr &proto) const

Reconstructs a index expression and its child nodes from protobuf data.

Related: ExprAST

deserializeIndexedAssignment

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeIndexedAssignment(const pbc::IndexedAssignment &proto) const

Reconstructs a indexed assignment and its child nodes from protobuf data.

Related: ExprAST

deserializeInterfaceDef

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeInterfaceDef(const pbc::InterfaceDef &proto) const

Reconstructs a interface declaration and its child nodes from protobuf data.

Related: ExprAST

deserializeInterpolatedString

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeInterpolatedString(const pbc::InterpolatedString &proto) const

Reconstructs a interpolated string and its child nodes from protobuf data.

Related: ExprAST

deserializeLambda

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeLambda(const pbc::LambdaExpr &proto) const

Reconstructs a lambda expression and its child nodes from protobuf data.

Related: ExprAST

deserializeManifest

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeManifest(const pbc::Manifest &proto) const

Reconstructs a dependency manifest and its child nodes from protobuf data.

Related: ExprAST

deserializeMatch

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeMatch(const pbc::MatchExpr &proto) const

Reconstructs a pattern match and its child nodes from protobuf data.

Related: ExprAST

deserializeMemberAccess

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeMemberAccess(const pbc::MemberAccess &proto) const

Reconstructs a member access and its child nodes from protobuf data.

Related: ExprAST

deserializeMemberAssignment

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeMemberAssignment(const pbc::MemberAssignment &proto) const

Reconstructs a member assignment and its child nodes from protobuf data.

Related: ExprAST

deserializeMethodFunction

private · function · Source (opens in a new tab)

std::unique_ptr< FunctionAST > sun::serialization::ASTDeserializer::deserializeMethodFunction(const pbc::FunctionDef &proto, bool emptyBodyMeansNone) const

The function behind a class or interface method.

An interface method with no statements is a bare declaration, so it comes back without a body; a class method with no statements has an empty body, and dropping that would leave the method looking like an extern declaration.

Related: sun::ast::FunctionAST

deserializeModule

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeModule(const pbc::ModuleDef &proto) const

Reconstructs a module declaration and its child nodes from protobuf data.

Related: ExprAST

deserializeNumber

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeNumber(const pbc::NumberExpr &proto) const

Individual node type deserializers.

Related: ExprAST

deserializePackExpansion

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializePackExpansion(const pbc::PackExpansion &proto) const

Reconstructs a variadic argument expansion and its child nodes from protobuf data.

Related: ExprAST

deserializeParen

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeParen(const pbc::ParenExpr &proto) const

Reconstructs a parenthesized expression and its child nodes from protobuf data.

Related: ExprAST

deserializePosition

private · function · Source (opens in a new tab)

Position sun::serialization::ASTDeserializer::deserializePosition(const pbc::Position &pos) const

Position deserialization.

Related: sun::support::Position, Position

deserializeQualifiedName

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeQualifiedName(const pbc::QualifiedNameExpr &proto) const

Reconstructs a qualified name and its child nodes from protobuf data.

Related: ExprAST

deserializeReferenceCreation

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeReferenceCreation(const pbc::ReferenceCreation &proto) const

Reconstructs a reference creation and its child nodes from protobuf data.

Related: ExprAST

deserializeReturn

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeReturn(const pbc::ReturnExpr &proto) const

Reconstructs a return statement and its child nodes from protobuf data.

Related: ExprAST

deserializeSlice

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeSlice(const pbc::SliceExpr &proto) const

Reconstructs a slice expression and its child nodes from protobuf data.

Related: ExprAST

deserializeSliceExpr

private · function · Source (opens in a new tab)

std::unique_ptr< SliceExprAST > sun::serialization::ASTDeserializer::deserializeSliceExpr(const pbc::SliceExpr &proto) const

Reconstructs a slice expression and its child nodes from protobuf data.

Related: sun::ast::SliceExprAST

deserializeString

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeString(const pbc::StringLiteral &proto) const

Reconstructs a string literal and its child nodes from protobuf data.

Related: ExprAST

deserializeStructLiteral

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeStructLiteral(const pbc::StructLiteral &proto) const

Reconstructs a field initializer list and its child nodes from protobuf data.

Related: ExprAST

deserializeTernary

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeTernary(const pbc::TernaryExpr &proto) const

Reconstructs a conditional expression and its child nodes from protobuf data.

Related: ExprAST

deserializeThrow

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeThrow(const pbc::ThrowExpr &proto) const

Reconstructs a throw expression and its child nodes from protobuf data.

Related: ExprAST

deserializeToken

private · function · Source (opens in a new tab)

Token sun::serialization::ASTDeserializer::deserializeToken(const pbc::Token &token) const

Token deserialization.

Related: sun::parsing::Token, Token

deserializeTryCatch

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeTryCatch(const pbc::TryCatch &proto) const

Reconstructs a error handler and its child nodes from protobuf data.

Related: ExprAST

deserializeTypeAnnotation

private · function · Source (opens in a new tab)

sun::ast::TypeAnnotation sun::serialization::ASTDeserializer::deserializeTypeAnnotation(const pbc::TypeAnnotation &type) const

Type annotation deserialization.

Related: sun::ast::TypeAnnotation

deserializeTypeParameters

private · function · Source (opens in a new tab)

template <typename Owner>
std::vector< sun::ast::TypeParameter > sun::serialization::ASTDeserializer::deserializeTypeParameters(const Owner &owner) const

Restore parameters from current metadata or the legacy names-only field.

Related: sun::ast::TypeParameter

deserializeUnary

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeUnary(const pbc::UnaryExpr &proto) const

Reconstructs a unary operation and its child nodes from protobuf data.

Related: ExprAST

deserializeUnsafeBlock

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeUnsafeBlock(const pbc::UnsafeBlock &proto) const

Reconstructs a unsafe block and its child nodes from protobuf data.

Related: ExprAST

deserializeUsing

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeUsing(const pbc::UsingStmt &proto) const

Reconstructs a using declaration and its child nodes from protobuf data.

Related: ExprAST

deserializeVariableAssignment

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeVariableAssignment(const pbc::VariableAssignment &proto) const

Reconstructs a variable assignment and its child nodes from protobuf data.

Related: ExprAST

deserializeVariableCreation

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeVariableCreation(const pbc::VariableCreation &proto) const

Reconstructs a variable declaration and its child nodes from protobuf data.

Related: ExprAST

deserializeVariableRef

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeVariableRef(const pbc::VariableReference &proto) const

Reconstructs a variable reference and its child nodes from protobuf data.

Related: ExprAST

deserializeWhile

private · function · Source (opens in a new tab)

std::unique_ptr< ExprAST > sun::serialization::ASTDeserializer::deserializeWhile(const pbc::WhileExpr &proto) const

Reconstructs a while loop and its child nodes from protobuf data.

Related: ExprAST

Private Fields

config_

private · variable · Source (opens in a new tab)

DeserializerConfig sun::serialization::ASTDeserializer::config_

No documentation comment.

Related: DeserializerConfig