<commit_before>package ast

import (
  "encoding/json"
)

// CastNode
type CastNode struct {
  Location Location
  Type ITypeNode
  Expr IExprNode
}

func NewCastNode(location Location, t ITypeNode, expr IExprNode) CastNode {
  return CastNode { location, t, expr }
}

func (self CastNode) String() string {
  panic("not implemented")
}

func (self CastNode) MarshalJSON() ([]byte, error) {
  var x struct {
    ClassName string
    Location Location
    Type ITypeNode
    Expr IExprNode
  }
  x.ClassName = "ast.CastNode"
  x.Location = self.Location
  x.Type = self.Type
  x.Expr = self.Expr
  return json.Marshal(x)
}

func (self CastNode) IsExpr() bool {
  return true
}

func (self CastNode) GetLocation() Location {
  return self.Location
}

// SizeofExprNode
type SizeofExprNode struct {
  Location Location
  Expr IExprNode
  Type ITypeNode
}

func NewSizeofExprNode(location Location, expr IExprNode, t ITypeNode) SizeofExprNode {
  return SizeofExprNode { location, expr, t }
}

func (self SizeofExprNode) String() string {
  panic("not implemented")
}

func (self SizeofExprNode) MarshalJSON() ([]byte, error) {
  var x struct {
    ClassName string
    Location Location
    Expr IExprNode
    Type ITypeNode
  }
  x.ClassName = "ast.SizeofExprNode"
  x.Location = self.Location
  x.Expr = self.Expr
  x.Type = self.Type
  return json.Marshal(x)
}

func (self SizeofExprNode) IsExpr() bool {
  return true
}

func (self SizeofExprNode) GetLocation() Location {
  return self.Location
}

// SizeofTypeNode
type SizeofTypeNode struct {
  Location Location
  Type ITypeNode
  Operand ITypeNode
}

func NewSizeofTypeNode(location Location, t ITypeNode, operand ITypeNode) SizeofTypeNode {
  return SizeofTypeNode { location, t, operand }
}

func (self SizeofTypeNode) String() string {
  panic("not implemented")
}

func (self SizeofTypeNode) MarshalJSON() ([]byte, error) {
  var x struct {
    ClassName string
    Location Location
    Type ITypeNode
    Operand ITypeNode
  }
  x.ClassName = "ast.SizeofTypeNode"
  x.Location = self.Location
  x.Type = self.Type
  x.Operand = self.Operand
  return json.Marshal(x)
}

func (self SizeofTypeNode) IsExpr() bool {
  return true
}

func (self SizeofTypeNode) GetLocation() Location {
  return self.Location
}
<commit_msg>Add more type nodes<commit_after>package ast

import (
  "encoding/json"
  "fmt"
  "bitbucket.org/yyuu/bs/typesys"
)

// CastNode
type CastNode struct {
  Location Location
  Type ITypeNode
  Expr IExprNode
}

func NewCastNode(location Location, t ITypeNode, expr IExprNode) CastNode {
  return CastNode { location, t, expr }
}

func (self CastNode) String() string {
  return fmt.Sprintf("(%s %s)", self.Type, self.Expr)
}

func (self CastNode) MarshalJSON() ([]byte, error) {
  var x struct {
    ClassName string
    Location Location
    Type ITypeNode
    Expr IExprNode
  }
  x.ClassName = "ast.CastNode"
  x.Location = self.Location
  x.Type = self.Type
  x.Expr = self.Expr
  return json.Marshal(x)
}

func (self CastNode) IsExpr() bool {
  return true
}

func (self CastNode) GetLocation() Location {
  return self.Location
}

// SizeofExprNode
type SizeofExprNode struct {
  Location Location
  Expr IExprNode
  Type ITypeNode
}

func NewSizeofExprNode(location Location, expr IExprNode, t typesys.ITypeRef) SizeofExprNode {
  return SizeofExprNode { location, expr, NewTypeNode(location, t) }
}

func (self SizeofExprNode) String() string {
  return fmt.Sprintf("(sizeof %s)", self.Expr)
}

func (self SizeofExprNode) MarshalJSON() ([]byte, error) {
  var x struct {
    ClassName string
    Location Location
    Expr IExprNode
    Type ITypeNode
  }
  x.ClassName = "ast.SizeofExprNode"
  x.Location = self.Location
  x.Expr = self.Expr
  x.Type = self.Type
  return json.Marshal(x)
}

func (self SizeofExprNode) IsExpr() bool {
  return true
}

func (self SizeofExprNode) GetLocation() Location {
  return self.Location
}

// SizeofTypeNode
type SizeofTypeNode struct {
  Location Location
  Type ITypeNode
  Operand ITypeNode
}

func NewSizeofTypeNode(location Location, operand ITypeNode, t typesys.ITypeRef) SizeofTypeNode {
  return SizeofTypeNode { location, operand, NewTypeNode(location, t) }
}

func (self SizeofTypeNode) String() string {
  return fmt.Sprintf("(sizeof %s)", self.Type)
}

func (self SizeofTypeNode) MarshalJSON() ([]byte, error) {
  var x struct {
    ClassName string
    Location Location
    Type ITypeNode
    Operand ITypeNode
  }
  x.ClassName = "ast.SizeofTypeNode"
  x.Location = self.Location
  x.Type = self.Type
  x.Operand = self.Operand
  return json.Marshal(x)
}

func (self SizeofTypeNode) IsExpr() bool {
  return true
}

func (self SizeofTypeNode) GetLocation() Location {
  return self.Location
}

// TypeNode
type TypeNode struct {
  Location Location
  TypeRef typesys.ITypeRef
}

func NewTypeNode(location Location, t typesys.ITypeRef) TypeNode {
  return TypeNode { location, t }
}

func (self TypeNode) String() string {
  return fmt.Sprintf("(type %s)", self.TypeRef)
}

func (self TypeNode) MarshalJSON() ([]byte, error) {
  var x struct {
    ClassName string
    Location Location
    TypeRef typesys.ITypeRef
  }
  x.ClassName = "ast.TypeNode"
  x.Location = self.Location
  x.TypeRef = self.TypeRef
  return json.Marshal(x)
}

func (self TypeNode) IsType() bool {
  return true
}

func (self TypeNode) GetLocation() Location {
  return self.Location
}

// TypedefNode
type TypedefNode struct {
  Location Location
  TypeNode ITypeNode
  Name string
}

func NewTypedefNode(location Location, t ITypeNode, name string) TypedefNode {
  return TypedefNode { location, t, name }
}

func (self TypedefNode) String() string {
  return fmt.Sprintf("(typedef %s %s)", self.Name, self.TypeNode)
}

func (self TypedefNode) MarshalJSON() ([]byte, error) {
  var x struct {
    ClassName string
    Location Location
    TypeNode ITypeNode
    Name string
  }
  x.ClassName = "ast.TypedefNode"
  x.Location = self.Location
  x.TypeNode = self.TypeNode
  x.Name = self.Name
  return json.Marshal(x)
}

func (self TypedefNode) IsType() bool {
  return true
}

func (self TypedefNode) GetLocation() Location {
  return self.Location
}

{'fraction_non_alphanumeric': 0.09760051880674449, 'fraction_numerical': 0.0, 'mean_word_length': 3.827073552425665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6361345', 'n_tokens_mistral': 2045, 'n_tokens_neox': 2026, 'n_words': 587}