2016-08-27 11:06:15 +02:00
|
|
|
// Copyright 2016 Google Inc. Use of this source code is governed by an
|
|
|
|
// MIT-style license that can be found in the LICENSE file or at
|
|
|
|
// https://opensource.org/licenses/MIT.
|
|
|
|
|
|
|
|
import 'package:source_span/source_span.dart';
|
|
|
|
|
|
|
|
import 'argument_declaration.dart';
|
|
|
|
import 'statement.dart';
|
|
|
|
|
2016-10-01 03:42:41 +02:00
|
|
|
/// An abstract class for callables (functions or mixins) that are declared in
|
|
|
|
/// user code.
|
2016-08-27 11:06:15 +02:00
|
|
|
abstract class CallableDeclaration implements Statement {
|
2016-10-01 03:42:41 +02:00
|
|
|
/// The name of this callable.
|
2016-08-27 11:06:15 +02:00
|
|
|
final String name;
|
|
|
|
|
2016-10-01 03:42:41 +02:00
|
|
|
/// The declared arguments this callable accepts.
|
2016-08-27 11:06:15 +02:00
|
|
|
final ArgumentDeclaration arguments;
|
|
|
|
|
2016-10-01 03:42:41 +02:00
|
|
|
/// The child statements that are executed when this callable is invoked.
|
2016-08-27 11:06:15 +02:00
|
|
|
final List<Statement> children;
|
|
|
|
|
|
|
|
final FileSpan span;
|
|
|
|
|
2016-08-29 00:04:48 +02:00
|
|
|
CallableDeclaration(
|
|
|
|
this.name, this.arguments, Iterable<Statement> children, this.span)
|
2016-08-27 11:06:15 +02:00
|
|
|
: children = new List.unmodifiable(children);
|
|
|
|
}
|