diff options
author | buraq <buraq@epfl.ch> | 2003-10-06 17:37:31 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-10-06 17:37:31 +0000 |
commit | f1d658c71e64cb81bd3f40cf23f25426de8900a9 (patch) | |
tree | 85179d2768482b8124ba4a5d03e4c69f4b960af3 /sources/scalac/transformer/matching/SequenceMatcher.java | |
parent | d49b034739b5071bfbc37c2c010a83d12d7405e4 (diff) | |
download | scala-f1d658c71e64cb81bd3f40cf23f25426de8900a9.tar.gz scala-f1d658c71e64cb81bd3f40cf23f25426de8900a9.tar.bz2 scala-f1d658c71e64cb81bd3f40cf23f25426de8900a9.zip |
fixed bug133, refactored code ignoreValue,Null ...
fixed bug133, refactored code ignoreValue,Null to calls to
TreeGen.mkDefaultValue
Diffstat (limited to 'sources/scalac/transformer/matching/SequenceMatcher.java')
-rw-r--r-- | sources/scalac/transformer/matching/SequenceMatcher.java | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/sources/scalac/transformer/matching/SequenceMatcher.java b/sources/scalac/transformer/matching/SequenceMatcher.java index f9d5b10e19..6ccadf51d0 100644 --- a/sources/scalac/transformer/matching/SequenceMatcher.java +++ b/sources/scalac/transformer/matching/SequenceMatcher.java @@ -31,86 +31,11 @@ public class SequenceMatcher extends PatternTool { Tree pat[]; Tree body[]; - /* - public Tree[] getNested( HashMap varMap ) { - Tree[][] stmsNest = new Tree[varMap.size()][]; - int i = 0; - int k = 0; - for( Iterator it = varMap.keySet().iterator() ; it.hasNext(); ) { - Tree pat = (Tree) it.next(); // contains variables - Symbol v = (Symbol) varMap.get( pat ); - - BindingBerrySethi build = new BindingBerrySethi(); - NondetWordAutom leftNest = build.automatonFrom( pat, - new Integer( 0 )); - - DetWordAutom dLeftNest = new DetWordAutom( leftNest ); - - NondetWordAutom rightNest = build.revnfa; - - Matcher mNest = new Matcher( _m.owner, _m.selector, null ); - - LeftTracerInScala ltisNest = - new LeftTracerInScala( dLeftNest, - cf.getElemType( pat.type() ), - mNest, - cf ); - Tree stmsLeftNest[] = ltisNest.getTrace(); - - Tree selNest = gen.Ident( Position.FIRSTPOS, ltisNest.resultSym ); - - DetWordAutom dRightNest = - new DetWordAutom( rightNest, leftNest, dLeftNest); - - RightTracerInScala rtisNest = - new RightTracerInScala( dRightNest, leftNest, mNest, - cf, pat, cf.getElemType(pat.type())); - - Tree stmsRightNest[] = rtisNest.getStms( gen.Ident( Position.FIRSTPOS, v ) ); - stmsNest[ i ] = new Tree[ stmsLeftNest.length - + stmsRightNest.length ]; - - System.arraycopy( stmsLeftNest, 0, - stmsNest[ i ], 0, stmsLeftNest.length ); - System.arraycopy( stmsRightNest, 0, stmsNest[ i ], - stmsLeftNest.length, stmsRightNest.length ); - k += stmsNest[ i ].length; - i++; - } - // flatten - Tree[] res = new Tree[ k ]; - k = 0; - for( i = 0; i < varMap.size(); i++ ) { - System.arraycopy( stmsNest[ i ], 0, res, k, stmsNest[ i ].length ); - k += stmsNest[ i ].length; - } - return res; - } - */ - /** translates the det/switching automaton to scala code * precondition: pat.type() corresponds to element type */ Tree addBinderToBody( Tree pat, Tree body ) { - /* - SplitNested spn = new SplitNested( pat, _m.owner, cf ); - - pat = spn.flatPat; // - - for( Iterator it = spn.nestedVarToPats.keySet().iterator(); - it.hasNext(); ){ - Symbol v = (Symbol) it.next(); - Tree nestPat = (Tree) spn.nestedVarToPats.get( v ); - Matcher mNest = new Matcher( _m.owner, gen.Ident(Position.FIRSTPOS, v), null ); - - Matcher saveM = _m; _m = mNest; - - Tree nbody = addBinderToBody( nestPat, body ); - _m = saveM; - body = nbody; - } - */ Type elementType = cf.getElemType_Sequence( pat.type() ); BindingBerrySethi build = new BindingBerrySethi(); |