org.overturetool.vdmj.patterns
Class ConcatenationPattern

java.lang.Object
  extended by org.overturetool.vdmj.patterns.Pattern
      extended by org.overturetool.vdmj.patterns.ConcatenationPattern
All Implemented Interfaces:
java.io.Serializable

public class ConcatenationPattern
extends Pattern

See Also:
Serialized Form

Field Summary
 Pattern left
           
 Pattern right
           
 
Fields inherited from class org.overturetool.vdmj.patterns.Pattern
location
 
Constructor Summary
ConcatenationPattern(Pattern left, LexLocation location, Pattern right)
           
 
Method Summary
 DefinitionList getDefinitions(Type type, NameScope scope)
          Get a list of definitions for the pattern's variables.
 int getLength()
           
 Expression getMatchingExpression()
          An expression that matches the pattern.
 NameValuePairList getNamedValues(Value expval, Context ctxt)
          Get a name/value pair list for the pattern's variables.
 Type getPossibleType()
          Get the type(s) that could match this pattern.
 LexNameList getVariableNames()
           
 boolean isConstrained()
           
 java.lang.String toString()
           
 void typeResolve(Environment env)
          Resolve any types that the pattern may use by looking up the type names in the environment passed.
 void unResolve()
          Clear the recursive type resolution flag.
 
Methods inherited from class org.overturetool.vdmj.patterns.Pattern
detail, detail2, patternFail, patternFail, report
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

left

public final Pattern left

right

public final Pattern right
Constructor Detail

ConcatenationPattern

public ConcatenationPattern(Pattern left,
                            LexLocation location,
                            Pattern right)
Method Detail

unResolve

public void unResolve()
Description copied from class: Pattern
Clear the recursive type resolution flag. This is a deep clear, used when recovering from type resolution errors.

Overrides:
unResolve in class Pattern

typeResolve

public void typeResolve(Environment env)
Description copied from class: Pattern
Resolve any types that the pattern may use by looking up the type names in the environment passed.

Overrides:
typeResolve in class Pattern
Parameters:
env - The environment to resolve types.

toString

public java.lang.String toString()
Specified by:
toString in class Pattern

getMatchingExpression

public Expression getMatchingExpression()
Description copied from class: Pattern
An expression that matches the pattern. This is used in PO generation when parameter patterns have to be passed to pre/post conditions as arguments. The result is almost the same as toString(), except for IgnorePatterns, which produce "don't care" variables.

Specified by:
getMatchingExpression in class Pattern
Returns:
An expression, being a value that matches the pattern.

getDefinitions

public DefinitionList getDefinitions(Type type,
                                     NameScope scope)
Description copied from class: Pattern
Get a list of definitions for the pattern's variables.

Specified by:
getDefinitions in class Pattern

getLength

public int getLength()
Overrides:
getLength in class Pattern
Returns:
The "length" of the pattern (eg. sequence and set patterns).

getVariableNames

public LexNameList getVariableNames()
Overrides:
getVariableNames in class Pattern
Returns:
A list of the pattern's variable names.

getNamedValues

public NameValuePairList getNamedValues(Value expval,
                                        Context ctxt)
                                 throws PatternMatchException
Description copied from class: Pattern
Get a name/value pair list for the pattern's variables.

Specified by:
getNamedValues in class Pattern
Throws:
PatternMatchException

getPossibleType

public Type getPossibleType()
Description copied from class: Pattern
Get the type(s) that could match this pattern.

Specified by:
getPossibleType in class Pattern

isConstrained

public boolean isConstrained()
Overrides:
isConstrained in class Pattern
Returns:
True if the pattern has constraints, such that matching values should be permuted, where necessary, to find a match.


Copyright © 2009. All Rights Reserved.