MessageFindingVisitor class
This visits the program source nodes looking for Intl.message uses that conform to its pattern and then creating the corresponding IntlMessage objects. We have to find both the enclosing function, and the Intl.message invocation.
- Inheritance
-
- Object
- GeneralizingAstVisitor
- MessageFindingVisitor
Constructors
- MessageFindingVisitor(MessageExtraction extraction)
Properties
- extraction → MessageExtraction
-
The message extraction in which we are running.
final
- generateNameAndArgs ↔ bool
-
Should we generate the name and arguments from the function definition,
meaning we're running in the transformer.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
messages
→ Map<
String, MainMessage> -
Accumulates the messages we have found, keyed by name.
final
- name ↔ String
-
getter/setter pair
- parameters ↔ FormalParameterList?
-
We keep track of the data from the last MethodDeclaration,
FunctionDeclaration or FunctionExpression that we saw on the way down,
as that will be the nearest parent of the Intl.message invocation.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addIntlMessage(
MethodInvocation node) → bool -
Check that the node looks like an Intl.message invocation, and create
the
IntlMessage
object from it and store it in messages. Return true if we successfully extracted a message and should stop looking. Return false if we didn't, so should continue recursing. -
checkValidity(
MethodInvocation node) → String? - Returns a String describing why the node is invalid, or null if no reason is found, so it's presumed valid.
-
looksLikeIntlMessage(
MethodInvocation node) → bool -
Return true if
node
matches the pattern we expect for Intl.message() -
messageFromDirectPluralOrGenderCall(
MethodInvocation node) → MainMessage? -
Create a MainMessage from
node
using the name and parameters of the last function/method declaration we encountered and the parameters to the Intl.plural or Intl.gender call. -
messageFromIntlMessageCall(
MethodInvocation node) → MainMessage? -
Create a MainMessage from
node
using the name and parameters of the last function/method declaration we encountered and the parameters to the Intl.message call. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
visitAdjacentStrings(
AdjacentStrings node) → dynamic -
inherited
-
visitAnnotatedNode(
AnnotatedNode node) → dynamic -
inherited
-
visitAnnotation(
Annotation node) → dynamic -
inherited
-
visitArgumentList(
ArgumentList node) → dynamic -
inherited
-
visitAsExpression(
AsExpression node) → dynamic -
inherited
-
visitAssertInitializer(
AssertInitializer node) → dynamic -
inherited
-
visitAssertStatement(
AssertStatement node) → dynamic -
inherited
-
visitAssignedVariablePattern(
AssignedVariablePattern node) → dynamic -
inherited
-
visitAssignmentExpression(
AssignmentExpression node) → dynamic -
inherited
-
visitAugmentationImportDirective(
AugmentationImportDirective node) → dynamic -
inherited
-
visitAwaitExpression(
AwaitExpression node) → dynamic -
inherited
-
visitBinaryExpression(
BinaryExpression node) → dynamic -
inherited
-
visitBlock(
Block node) → dynamic -
inherited
-
visitBlockFunctionBody(
BlockFunctionBody node) → dynamic -
inherited
-
visitBooleanLiteral(
BooleanLiteral node) → dynamic -
inherited
-
visitBreakStatement(
BreakStatement node) → dynamic -
inherited
-
visitCascadeExpression(
CascadeExpression node) → dynamic -
inherited
-
visitCaseClause(
CaseClause node) → dynamic -
inherited
-
visitCastPattern(
CastPattern node) → dynamic -
inherited
-
visitCatchClause(
CatchClause node) → dynamic -
inherited
-
visitCatchClauseParameter(
CatchClauseParameter node) → dynamic -
inherited
-
visitClassDeclaration(
ClassDeclaration node) → dynamic -
inherited
-
visitClassMember(
ClassMember node) → dynamic -
inherited
-
visitClassTypeAlias(
ClassTypeAlias node) → dynamic -
inherited
-
visitCollectionElement(
CollectionElement node) → dynamic -
inherited
-
visitCombinator(
Combinator node) → dynamic -
inherited
-
visitComment(
Comment node) → dynamic -
inherited
-
visitCommentReference(
CommentReference node) → dynamic -
inherited
-
visitCompilationUnit(
CompilationUnit node) → dynamic -
inherited
-
visitCompilationUnitMember(
CompilationUnitMember node) → dynamic -
inherited
-
visitConditionalExpression(
ConditionalExpression node) → dynamic -
inherited
-
visitConfiguration(
Configuration node) → dynamic -
inherited
-
visitConstantPattern(
ConstantPattern node) → dynamic -
inherited
-
visitConstructorDeclaration(
ConstructorDeclaration node) → dynamic -
inherited
-
visitConstructorFieldInitializer(
ConstructorFieldInitializer node) → dynamic -
inherited
-
visitConstructorInitializer(
ConstructorInitializer node) → dynamic -
inherited
-
visitConstructorName(
ConstructorName node) → dynamic -
inherited
-
visitConstructorReference(
ConstructorReference node) → dynamic -
inherited
-
visitConstructorSelector(
ConstructorSelector node) → dynamic -
inherited
-
visitContinueStatement(
ContinueStatement node) → dynamic -
inherited
-
visitDartPattern(
DartPattern node) → dynamic -
inherited
-
visitDeclaration(
Declaration node) → dynamic -
inherited
-
visitDeclaredIdentifier(
DeclaredIdentifier node) → dynamic -
inherited
-
visitDeclaredVariablePattern(
DeclaredVariablePattern node) → dynamic -
inherited
-
visitDefaultFormalParameter(
DefaultFormalParameter node) → dynamic -
inherited
-
visitDirective(
Directive node) → dynamic -
inherited
-
visitDoStatement(
DoStatement node) → dynamic -
inherited
-
visitDottedName(
DottedName node) → dynamic -
inherited
-
visitDoubleLiteral(
DoubleLiteral node) → dynamic -
inherited
-
visitEmptyFunctionBody(
EmptyFunctionBody node) → dynamic -
inherited
-
visitEmptyStatement(
EmptyStatement node) → dynamic -
inherited
-
visitEnumConstantArguments(
EnumConstantArguments node) → dynamic -
inherited
-
visitEnumConstantDeclaration(
EnumConstantDeclaration node) → dynamic -
inherited
-
visitEnumDeclaration(
EnumDeclaration node) → dynamic -
inherited
-
visitExportDirective(
ExportDirective node) → dynamic -
inherited
-
visitExpression(
Expression node) → dynamic -
inherited
-
visitExpressionFunctionBody(
ExpressionFunctionBody node) → dynamic -
inherited
-
visitExpressionStatement(
ExpressionStatement node) → dynamic -
inherited
-
visitExtendsClause(
ExtendsClause node) → dynamic -
inherited
-
visitExtensionDeclaration(
ExtensionDeclaration node) → dynamic -
inherited
-
visitExtensionOverride(
ExtensionOverride node) → dynamic -
inherited
-
visitFieldDeclaration(
FieldDeclaration node) → void -
Record the name of field declaration we last
encountered before seeing the Intl.message call.
override
-
visitFieldFormalParameter(
FieldFormalParameter node) → dynamic -
inherited
-
visitForEachParts(
ForEachParts node) → dynamic -
inherited
-
visitForEachPartsWithDeclaration(
ForEachPartsWithDeclaration node) → dynamic -
inherited
-
visitForEachPartsWithIdentifier(
ForEachPartsWithIdentifier node) → dynamic -
inherited
-
visitForEachPartsWithPattern(
ForEachPartsWithPattern node) → dynamic -
inherited
-
visitForElement(
ForElement node) → dynamic -
inherited
-
visitFormalParameter(
FormalParameter node) → dynamic -
inherited
-
visitFormalParameterList(
FormalParameterList node) → dynamic -
inherited
-
visitForParts(
ForParts node) → dynamic -
inherited
-
visitForPartsWithDeclarations(
ForPartsWithDeclarations node) → dynamic -
inherited
-
visitForPartsWithExpression(
ForPartsWithExpression node) → dynamic -
inherited
-
visitForPartsWithPattern(
ForPartsWithPattern node) → dynamic -
inherited
-
visitForStatement(
ForStatement node) → dynamic -
inherited
-
visitFunctionBody(
FunctionBody node) → dynamic -
inherited
-
visitFunctionDeclaration(
FunctionDeclaration node) → void -
Record the parameters of the function or method declaration we last
encountered before seeing the Intl.message call.
override
-
visitFunctionDeclarationStatement(
FunctionDeclarationStatement node) → dynamic -
inherited
-
visitFunctionExpression(
FunctionExpression node) → dynamic -
inherited
-
visitFunctionExpressionInvocation(
FunctionExpressionInvocation node) → dynamic -
inherited
-
visitFunctionReference(
FunctionReference node) → dynamic -
inherited
-
visitFunctionTypeAlias(
FunctionTypeAlias node) → dynamic -
inherited
-
visitFunctionTypedFormalParameter(
FunctionTypedFormalParameter node) → dynamic -
inherited
-
visitGenericFunctionType(
GenericFunctionType node) → dynamic -
inherited
-
visitGenericTypeAlias(
GenericTypeAlias node) → dynamic -
inherited
-
visitGuardedPattern(
GuardedPattern node) → dynamic -
inherited
-
visitHideCombinator(
HideCombinator node) → dynamic -
inherited
-
visitIdentifier(
Identifier node) → dynamic -
inherited
-
visitIfElement(
IfElement node) → dynamic -
inherited
-
visitIfStatement(
IfStatement node) → dynamic -
inherited
-
visitImplementsClause(
ImplementsClause node) → dynamic -
inherited
-
visitImplicitCallReference(
ImplicitCallReference node) → dynamic -
inherited
-
visitImportDirective(
ImportDirective node) → dynamic -
inherited
-
visitImportPrefixReference(
ImportPrefixReference node) → dynamic -
inherited
-
visitIndexExpression(
IndexExpression node) → dynamic -
inherited
-
visitInstanceCreationExpression(
InstanceCreationExpression node) → dynamic -
inherited
-
visitIntegerLiteral(
IntegerLiteral node) → dynamic -
inherited
-
visitInterpolationElement(
InterpolationElement node) → dynamic -
inherited
-
visitInterpolationExpression(
InterpolationExpression node) → dynamic -
inherited
-
visitInterpolationString(
InterpolationString node) → dynamic -
inherited
-
visitInvocationExpression(
InvocationExpression node) → dynamic -
inherited
-
visitIsExpression(
IsExpression node) → dynamic -
inherited
-
visitLabel(
Label node) → dynamic -
inherited
-
visitLabeledStatement(
LabeledStatement node) → dynamic -
inherited
-
visitLibraryAugmentationDirective(
LibraryAugmentationDirective node) → dynamic -
inherited
-
visitLibraryDirective(
LibraryDirective node) → dynamic -
inherited
-
visitLibraryIdentifier(
LibraryIdentifier node) → dynamic -
inherited
-
visitListLiteral(
ListLiteral node) → dynamic -
inherited
-
visitListPattern(
ListPattern node) → dynamic -
inherited
-
visitLiteral(
Literal node) → dynamic -
inherited
-
visitLogicalAndPattern(
LogicalAndPattern node) → dynamic -
inherited
-
visitLogicalOrPattern(
LogicalOrPattern node) → dynamic -
inherited
-
visitMapLiteralEntry(
MapLiteralEntry node) → dynamic -
inherited
-
visitMapPattern(
MapPattern node) → dynamic -
inherited
-
visitMapPatternEntry(
MapPatternEntry node) → dynamic -
inherited
-
visitMethodDeclaration(
MethodDeclaration node) → void -
Record the parameters of the function or method declaration we last
encountered before seeing the Intl.message call.
override
-
visitMethodInvocation(
MethodInvocation node) → void -
Examine method invocations to see if they look like calls to Intl.message.
If we've found one, stop recursing. This is important because we can have
Intl.message(...Intl.plural...) and we don't want to treat the inner
plural as if it was an outermost message.
override
-
visitMixinDeclaration(
MixinDeclaration node) → dynamic -
inherited
-
visitNamedCompilationUnitMember(
NamedCompilationUnitMember node) → dynamic -
inherited
-
visitNamedExpression(
NamedExpression node) → dynamic -
inherited
-
visitNamedType(
NamedType node) → dynamic -
inherited
-
visitNamespaceDirective(
NamespaceDirective node) → dynamic -
inherited
-
visitNativeClause(
NativeClause node) → dynamic -
inherited
-
visitNativeFunctionBody(
NativeFunctionBody node) → dynamic -
inherited
-
visitNode(
AstNode node) → dynamic -
inherited
-
visitNormalFormalParameter(
NormalFormalParameter node) → dynamic -
inherited
-
visitNullAssertPattern(
NullAssertPattern node) → dynamic -
inherited
-
visitNullCheckPattern(
NullCheckPattern node) → dynamic -
inherited
-
visitNullLiteral(
NullLiteral node) → dynamic -
inherited
-
visitObjectPattern(
ObjectPattern node) → dynamic -
inherited
-
visitOnClause(
OnClause node) → dynamic -
inherited
-
visitParenthesizedExpression(
ParenthesizedExpression node) → dynamic -
inherited
-
visitParenthesizedPattern(
ParenthesizedPattern node) → dynamic -
inherited
-
visitPartDirective(
PartDirective node) → dynamic -
inherited
-
visitPartOfDirective(
PartOfDirective node) → dynamic -
inherited
-
visitPatternAssignment(
PatternAssignment node) → dynamic -
inherited
-
visitPatternField(
PatternField node) → dynamic -
inherited
-
visitPatternFieldName(
PatternFieldName node) → dynamic -
inherited
-
visitPatternVariableDeclaration(
PatternVariableDeclaration node) → dynamic -
inherited
-
visitPatternVariableDeclarationStatement(
PatternVariableDeclarationStatement node) → dynamic -
inherited
-
visitPostfixExpression(
PostfixExpression node) → dynamic -
inherited
-
visitPrefixedIdentifier(
PrefixedIdentifier node) → dynamic -
inherited
-
visitPrefixExpression(
PrefixExpression node) → dynamic -
inherited
-
visitPropertyAccess(
PropertyAccess node) → dynamic -
inherited
-
visitRecordLiteral(
RecordLiteral node) → dynamic -
inherited
-
visitRecordPattern(
RecordPattern node) → dynamic -
inherited
-
visitRecordTypeAnnotation(
RecordTypeAnnotation node) → dynamic -
inherited
-
visitRecordTypeAnnotationField(
RecordTypeAnnotationField node) → dynamic -
inherited
-
visitRecordTypeAnnotationNamedField(
RecordTypeAnnotationNamedField node) → dynamic -
inherited
-
visitRecordTypeAnnotationNamedFields(
RecordTypeAnnotationNamedFields node) → dynamic -
inherited
-
visitRecordTypeAnnotationPositionalField(
RecordTypeAnnotationPositionalField node) → dynamic -
inherited
-
visitRedirectingConstructorInvocation(
RedirectingConstructorInvocation node) → dynamic -
inherited
-
visitRelationalPattern(
RelationalPattern node) → dynamic -
inherited
-
visitRestPatternElement(
RestPatternElement node) → dynamic -
inherited
-
visitRethrowExpression(
RethrowExpression node) → dynamic -
inherited
-
visitReturnStatement(
ReturnStatement node) → dynamic -
inherited
-
visitScriptTag(
ScriptTag scriptTag) → dynamic -
inherited
-
visitSetOrMapLiteral(
SetOrMapLiteral node) → dynamic -
inherited
-
visitShowCombinator(
ShowCombinator node) → dynamic -
inherited
-
visitSimpleFormalParameter(
SimpleFormalParameter node) → dynamic -
inherited
-
visitSimpleIdentifier(
SimpleIdentifier node) → dynamic -
inherited
-
visitSimpleStringLiteral(
SimpleStringLiteral node) → dynamic -
inherited
-
visitSingleStringLiteral(
SingleStringLiteral node) → dynamic -
inherited
-
visitSpreadElement(
SpreadElement node) → dynamic -
inherited
-
visitStatement(
Statement node) → dynamic -
inherited
-
visitStringInterpolation(
StringInterpolation node) → dynamic -
inherited
-
visitStringLiteral(
StringLiteral node) → dynamic -
inherited
-
visitSuperConstructorInvocation(
SuperConstructorInvocation node) → dynamic -
inherited
-
visitSuperExpression(
SuperExpression node) → dynamic -
inherited
-
visitSuperFormalParameter(
SuperFormalParameter node) → dynamic -
inherited
-
visitSwitchCase(
SwitchCase node) → dynamic -
inherited
-
visitSwitchDefault(
SwitchDefault node) → dynamic -
inherited
-
visitSwitchExpression(
SwitchExpression node) → dynamic -
inherited
-
visitSwitchExpressionCase(
SwitchExpressionCase node) → dynamic -
inherited
-
visitSwitchMember(
SwitchMember node) → dynamic -
inherited
-
visitSwitchPatternCase(
SwitchPatternCase node) → dynamic -
inherited
-
visitSwitchStatement(
SwitchStatement node) → dynamic -
inherited
-
visitSymbolLiteral(
SymbolLiteral node) → dynamic -
inherited
-
visitThisExpression(
ThisExpression node) → dynamic -
inherited
-
visitThrowExpression(
ThrowExpression node) → dynamic -
inherited
-
visitTopLevelVariableDeclaration(
TopLevelVariableDeclaration node) → void -
Record the name of the top level variable declaration we last
encountered before seeing the Intl.message call.
override
-
visitTryStatement(
TryStatement node) → dynamic -
inherited
-
visitTypeAlias(
TypeAlias node) → dynamic -
inherited
-
visitTypeAnnotation(
TypeAnnotation node) → dynamic -
inherited
-
visitTypeArgumentList(
TypeArgumentList node) → dynamic -
inherited
-
visitTypedLiteral(
TypedLiteral node) → dynamic -
inherited
-
visitTypeLiteral(
TypeLiteral node) → dynamic -
inherited
-
visitTypeParameter(
TypeParameter node) → dynamic -
inherited
-
visitTypeParameterList(
TypeParameterList node) → dynamic -
inherited
-
visitUriBasedDirective(
UriBasedDirective node) → dynamic -
inherited
-
visitVariableDeclaration(
VariableDeclaration node) → dynamic -
inherited
-
visitVariableDeclarationList(
VariableDeclarationList node) → dynamic -
inherited
-
visitVariableDeclarationStatement(
VariableDeclarationStatement node) → dynamic -
inherited
-
visitWhenClause(
WhenClause node) → dynamic -
inherited
-
visitWhileStatement(
WhileStatement node) → dynamic -
inherited
-
visitWildcardPattern(
WildcardPattern node) → dynamic -
inherited
-
visitWithClause(
WithClause node) → dynamic -
inherited
-
visitYieldStatement(
YieldStatement node) → dynamic -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited