def visitShapeExprDecl(self, ctx: ShExDocParser.ShapeExprDeclContext):
label = self.context.shapeexprlabel_to_IRI(ctx.shapeExprLabel())<EOL>if self.context.schema.shapes is None:<EOL><INDENT>self.context.schema.shapes = []<EOL><DEDENT>if ctx.KW_EXTERNAL():<EOL><INDENT>shape = ShapeExternal(id=label)<EOL><DEDENT>else:<EOL><INDENT>shexpr = ShexShapeExpressionParser(self.context, label)<EOL>shexpr.visit(ctx.shapeExpression())<EOL>shape = shexpr.expr<EOL><DEDENT>self.context.schema.shapes.append(shape)<EOL>
shapeExprDecl: shapeExprLabel (shapeExpression | KW_EXTERNAL)