PluralAndGenderVisitor class

A visitor to extract information from Intl.plural/gender sends. Note that this is a SimpleAstVisitor, so it doesn't automatically recurse. So this needs to be called where we expect a plural or gender immediately below.

Inheritance

Constructors

PluralAndGenderVisitor(List pieces, ComplexMessage parent, MessageExtraction extraction)

Properties

extraction MessageExtraction
The message extraction in which we are running.
final
foundPluralOrGender ↔ bool
This will be set to true if we find a plural or gender.
read / write
parent → ComplexMessage
A plural or gender always exists in the context of a parent message, which could in turn also be a plural or gender.
final
pieces ↔ List
The pieces of the message. We are given an initial version of this from our parent and we add to it as we find additional information.
read / write
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

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.
looksLikePluralOrGender(Expression expression) → bool
Return true if node matches the pattern for plural or gender message.
messageFromMethodInvocation(MethodInvocation node) → Message
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.
visitInterpolationExpression(InterpolationExpression node) → dynamic
override
visitMethodInvocation(MethodInvocation node) → dynamic
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited
visitAdjacentStrings(AdjacentStrings 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
visitAssignmentExpression(AssignmentExpression 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
visitCatchClause(CatchClause node) → dynamic
inherited
visitClassDeclaration(ClassDeclaration node) → dynamic
inherited
visitClassTypeAlias(ClassTypeAlias node) → dynamic
inherited
visitComment(Comment node) → dynamic
inherited
visitCommentReference(CommentReference node) → dynamic
inherited
visitCompilationUnit(CompilationUnit node) → dynamic
inherited
visitConditionalExpression(ConditionalExpression node) → dynamic
inherited
visitConfiguration(Configuration node) → dynamic
inherited
visitConstructorDeclaration(ConstructorDeclaration node) → dynamic
inherited
visitConstructorFieldInitializer(ConstructorFieldInitializer node) → dynamic
inherited
visitConstructorName(ConstructorName node) → dynamic
inherited
visitContinueStatement(ContinueStatement node) → dynamic
inherited
visitDeclaredIdentifier(DeclaredIdentifier node) → dynamic
inherited
visitDefaultFormalParameter(DefaultFormalParameter 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
visitEnumConstantDeclaration(EnumConstantDeclaration node) → dynamic
inherited
visitEnumDeclaration(EnumDeclaration node) → dynamic
inherited
visitExportDirective(ExportDirective 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) → dynamic
inherited
visitFieldFormalParameter(FieldFormalParameter node) → dynamic
inherited
visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) → dynamic
inherited
visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) → dynamic
inherited
visitForElement(ForElement node) → dynamic
inherited
visitFormalParameterList(FormalParameterList node) → dynamic
inherited
visitForPartsWithDeclarations(ForPartsWithDeclarations node) → dynamic
inherited
visitForPartsWithExpression(ForPartsWithExpression node) → dynamic
inherited
visitForStatement(ForStatement node) → dynamic
inherited
visitFunctionDeclaration(FunctionDeclaration node) → dynamic
inherited
visitFunctionDeclarationStatement(FunctionDeclarationStatement node) → dynamic
inherited
visitFunctionExpression(FunctionExpression node) → dynamic
inherited
visitFunctionExpressionInvocation(FunctionExpressionInvocation node) → dynamic
inherited
visitFunctionTypeAlias(FunctionTypeAlias node) → dynamic
inherited
visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) → dynamic
inherited
visitGenericFunctionType(GenericFunctionType node) → dynamic
inherited
visitGenericTypeAlias(GenericTypeAlias node) → dynamic
inherited
visitHideCombinator(HideCombinator node) → dynamic
inherited
visitIfElement(IfElement node) → dynamic
inherited
visitIfStatement(IfStatement node) → dynamic
inherited
visitImplementsClause(ImplementsClause node) → dynamic
inherited
visitImportDirective(ImportDirective node) → dynamic
inherited
visitIndexExpression(IndexExpression node) → dynamic
inherited
visitInstanceCreationExpression(InstanceCreationExpression node) → dynamic
inherited
visitIntegerLiteral(IntegerLiteral node) → dynamic
inherited
visitInterpolationString(InterpolationString node) → dynamic
inherited
visitIsExpression(IsExpression node) → dynamic
inherited
visitLabel(Label node) → dynamic
inherited
visitLabeledStatement(LabeledStatement node) → dynamic
inherited
visitLibraryDirective(LibraryDirective node) → dynamic
inherited
visitLibraryIdentifier(LibraryIdentifier node) → dynamic
inherited
visitListLiteral(ListLiteral node) → dynamic
inherited
visitMapLiteralEntry(MapLiteralEntry node) → dynamic
inherited
visitMethodDeclaration(MethodDeclaration node) → dynamic
inherited
visitMixinDeclaration(MixinDeclaration node) → dynamic
inherited
visitNamedExpression(NamedExpression node) → dynamic
inherited
visitNativeClause(NativeClause node) → dynamic
inherited
visitNativeFunctionBody(NativeFunctionBody node) → dynamic
inherited
visitNullLiteral(NullLiteral node) → dynamic
inherited
visitOnClause(OnClause node) → dynamic
inherited
visitParenthesizedExpression(ParenthesizedExpression node) → dynamic
inherited
visitPartDirective(PartDirective node) → dynamic
inherited
visitPartOfDirective(PartOfDirective node) → dynamic
inherited
visitPostfixExpression(PostfixExpression node) → dynamic
inherited
visitPrefixedIdentifier(PrefixedIdentifier node) → dynamic
inherited
visitPrefixExpression(PrefixExpression node) → dynamic
inherited
visitPropertyAccess(PropertyAccess node) → dynamic
inherited
visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) → dynamic
inherited
visitRethrowExpression(RethrowExpression node) → dynamic
inherited
visitReturnStatement(ReturnStatement node) → dynamic
inherited
visitScriptTag(ScriptTag node) → 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
visitSpreadElement(SpreadElement node) → dynamic
inherited
visitStringInterpolation(StringInterpolation node) → dynamic
inherited
visitSuperConstructorInvocation(SuperConstructorInvocation node) → dynamic
inherited
visitSuperExpression(SuperExpression node) → dynamic
inherited
visitSwitchCase(SwitchCase node) → dynamic
inherited
visitSwitchDefault(SwitchDefault 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) → dynamic
inherited
visitTryStatement(TryStatement node) → dynamic
inherited
visitTypeArgumentList(TypeArgumentList node) → dynamic
inherited
visitTypeName(TypeName node) → dynamic
inherited
visitTypeParameter(TypeParameter node) → dynamic
inherited
visitTypeParameterList(TypeParameterList node) → dynamic
inherited
visitVariableDeclaration(VariableDeclaration node) → dynamic
inherited
visitVariableDeclarationList(VariableDeclarationList node) → dynamic
inherited
visitVariableDeclarationStatement(VariableDeclarationStatement node) → dynamic
inherited
visitWhileStatement(WhileStatement node) → dynamic
inherited
visitWithClause(WithClause node) → dynamic
inherited
visitYieldStatement(YieldStatement node) → dynamic
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited