klyn.code.ast.DeclarationNode.DeclarationNode
constructor
public DeclarationNode(
kind as DeclarationKind,
name as String,
signature as String,
range as SourceRange,
visibility as String = "",
returnType as String = "",
docComment as String = ""
)
Description

Constructs a DeclarationNode.

Parameters
ParameterDescription
kindStructural kind of declaration.
nameSimple identifier name of the symbol.
signatureFull header/signature text of the declaration.
rangeSource range spanned by the declaration.
visibilityVisibility modifier ("public", "protected", "private", or "").
returnTypeDeclared return or value type (or "").
docCommentAssociated documentation comment text (or "").
Example
import klyn.code.ast

node = DeclarationNode(DeclarationKind.FUNCTION, "compute", "def compute(x as Int) as Int", SourceRange(0, 0, 4, 0), "public", "Int")
assert node.name == "compute"