/var/log/messages

Aug 23, 2018 - 1 minute read - Comments - memo

今日のもくもく控え

S 式、は以下な形?

type SExpressionStatement struct {
    Expression car
    Expression cdr
}

func (ses *SExpressionStatement) statementNode()       {}
func (ses *SExpressionStatement) TokenLiteral() string { return "" }
func (ses *SExpressionStatement) String() string {
    if ses.Expression != nil {
        return "(" + ses.car.String() + "." + ses.cdr.String() + ")"
    }
    return "()"
}

これだと S 式の場合

(dlv) p program.Statements[0]
scheme_interpreter/ast.Statement(*scheme_interpreter/ast.ExpressionStatement) *{
        Token: scheme_interpreter/token.Token {Type: "(", Literal: "("},
        Expression: scheme_interpreter/ast.SExpression , {}}

みたいな形でネストしつつ、なのかどうか。

Gremlin Exporter asciidoc

comments powered by Disqus