MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenShadingLanguage / ASTfunction_declaration

Class ASTfunction_declaration

src/liboslcomp/ast.h:419–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417
418
419class ASTfunction_declaration : public ASTNode
420{
421public:
422 ASTfunction_declaration (OSLCompilerImpl *comp, TypeSpec type, ustring name,
423 ASTNode *form, ASTNode *stmts, ASTNode *meta=NULL);
424 const char *nodetypename () const { return "function_declaration"; }
425 const char *childname (size_t i) const;
426 void print (std::ostream &out, int indentlevel=0) const;
427 TypeSpec typecheck (TypeSpec expected);
428 Symbol *codegen (Symbol *dest = NULL) {
429 return NULL; // generates no code on its own
430 }
431
432 ref metadata () const { return child (0); }
433 ref formals () const { return child (1); }
434 ref statements () const { return child (2); }
435 FunctionSymbol *func () const { return (FunctionSymbol *)m_sym; }
436
437 bool is_builtin () const { return m_is_builtin; }
438 void add_meta (ref meta);
439
440private:
441 ustring m_name;
442 Symbol *m_sym;
443 bool m_is_builtin;
444};
445
446
447

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected