Permalink
Browse files

SI-6811 Move scala.util.{automata,regexp} ...

... to scala.xml.dtd.impl and make it private[dtd]
  • Loading branch information...
1 parent 1e69a0b commit a9c374b56fb418b62fc3dda57d5646ecdc6a5626 @soc soc committed Jan 20, 2013
@@ -11,8 +11,7 @@
package scala.xml
package dtd
-import scala.util.regexp.WordExp
-import scala.util.automata._
+import scala.xml.dtd.impl._
import scala.xml.Utility.sbToString
import PartialFunction._
@@ -18,8 +18,7 @@ package dtd
* @param extID NoExternalID or the external ID of this doctype
* @param intSubset sequence of internal subset declarations
*/
-case class DocType(name: String, extID: ExternalID, intSubset: Seq[dtd.Decl])
-{
+case class DocType(name: String, extID: ExternalID, intSubset: Seq[dtd.Decl]) {
if (!Utility.isName(name))
throw new IllegalArgumentException(name+" must be an XML Name")
@@ -33,8 +32,7 @@ case class DocType(name: String, extID: ExternalID, intSubset: Seq[dtd.Decl])
}
}
-object DocType
-{
+object DocType {
/** Creates a doctype with no external id, nor internal subset declarations. */
def apply(name: String): DocType = apply(name, NoExternalID, Nil)
}
@@ -12,10 +12,12 @@ package scala.xml
package dtd
import PartialFunction._
+import scala.collection.mutable
+
import ContentModel.ElemName
import MakeValidationException._ // @todo other exceptions
-import scala.util.automata._
-import scala.collection.mutable
+
+import impl._
/** validate children and/or attributes of an element
* exceptions are created but not thrown.
@@ -14,8 +14,7 @@ package dtd
*
* @author Burak Emir
*/
-abstract class ExternalID extends parsing.TokenTests
-{
+abstract class ExternalID extends parsing.TokenTests {
def quoted(s: String) = {
val c = if (s contains '"') '\'' else '"'
c + s + c
@@ -8,7 +8,7 @@
-package scala.util.regexp
+package scala.xml.dtd.impl
/** Basic regular expressions.
*
@@ -17,7 +17,7 @@ package scala.util.regexp
*/
@deprecated("This class will be removed", "2.10.0")
-abstract class Base {
+private[dtd] abstract class Base {
type _regexpT <: RegExp
abstract class RegExp {
@@ -6,9 +6,8 @@
** |/ **
\* */
-package scala.util.automata
+package scala.xml.dtd.impl
-import scala.util.regexp.{ Base }
import scala.collection.{ mutable, immutable }
// todo: replace global variable pos with acc
@@ -18,7 +17,7 @@ import scala.collection.{ mutable, immutable }
* position automata construction (also called ''Berry-Sethi'' or ''Glushkov'').
*/
@deprecated("This class will be removed", "2.10.0")
-abstract class BaseBerrySethi {
+private[dtd] abstract class BaseBerrySethi {
val lang: Base
import lang.{ Alt, Eps, Meta, RegExp, Sequ, Star }
@@ -6,7 +6,7 @@
** |/ **
\* */
-package scala.util.automata
+package scala.xml.dtd.impl
import scala.collection.{ mutable, immutable }
@@ -21,7 +21,7 @@ import scala.collection.{ mutable, immutable }
* @version 1.0
*/
@deprecated("This class will be removed", "2.10.0")
-abstract class DetWordAutom[T <: AnyRef] {
+private[dtd] abstract class DetWordAutom[T <: AnyRef] {
val nstates: Int
val finals: Array[Int]
val delta: Array[mutable.Map[T, Int]]
@@ -8,7 +8,7 @@
-package scala.util.automata
+package scala.xml.dtd.impl
/** A fast test of language inclusion between minimal automata.
@@ -18,7 +18,7 @@ package scala.util.automata
* @version 1.0
*/
@deprecated("This class will be removed", "2.10.0")
-trait Inclusion[A <: AnyRef] {
+private[dtd] trait Inclusion[A <: AnyRef] {
val labels: Seq[A]
@@ -6,7 +6,7 @@
** |/ **
\* */
-package scala.util.automata
+package scala.xml.dtd.impl
import scala.collection.{ immutable, mutable }
@@ -18,7 +18,7 @@ import scala.collection.{ immutable, mutable }
* the partial function `finals` is defined.
*/
@deprecated("This class will be removed", "2.10.0")
-abstract class NondetWordAutom[T <: AnyRef] {
+private[dtd] abstract class NondetWordAutom[T <: AnyRef] {
val nstates: Int
val labels: Seq[T]
val finals: Array[Int] // 0 means not final
@@ -8,15 +8,15 @@
-package scala.util.regexp
+package scala.xml.dtd.impl
/** Pointed regular hedge expressions, a useful subclass of regular hedge expressions.
*
* @author Burak Emir
* @version 1.0
*/
@deprecated("This class will be removed", "2.10.0")
-abstract class PointedHedgeExp extends Base {
+private[dtd] abstract class PointedHedgeExp extends Base {
type _regexpT <: RegExp
type _labelT
@@ -6,12 +6,12 @@
** |/ **
\* */
-package scala.util.automata
+package scala.xml.dtd.impl
import scala.collection.{ mutable, immutable }
@deprecated("This class will be removed", "2.10.0")
-class SubsetConstruction[T <: AnyRef](val nfa: NondetWordAutom[T]) {
+private[dtd] class SubsetConstruction[T <: AnyRef](val nfa: NondetWordAutom[T]) {
import nfa.labels
def selectTag(Q: immutable.BitSet, finals: Array[Int]) =
@@ -8,7 +8,7 @@
-package scala.util.regexp
+package scala.xml.dtd.impl
/** This runtime exception is thrown if an attempt to instantiate a
* syntactically incorrect expression is detected.
@@ -17,4 +17,4 @@ package scala.util.regexp
* @version 1.0
*/
@deprecated("This class will be removed", "2.10.0")
-class SyntaxError(e: String) extends RuntimeException(e)
+private[dtd] class SyntaxError(e: String) extends RuntimeException(e)
@@ -6,10 +6,9 @@
** |/ **
\* */
-package scala.util.automata
+package scala.xml.dtd.impl
import scala.collection.{ immutable, mutable }
-import scala.util.regexp.WordExp
/** This class turns a regular expression into a [[scala.util.automata.NondetWordAutom]]
* celebrated position automata construction (also called ''Berry-Sethi'' or ''Glushkov'').
@@ -18,7 +17,7 @@ import scala.util.regexp.WordExp
* @version 1.0
*/
@deprecated("This class will be removed", "2.10.0")
-abstract class WordBerrySethi extends BaseBerrySethi {
+private[dtd] abstract class WordBerrySethi extends BaseBerrySethi {
override val lang: WordExp
import lang.{ Alt, Eps, Letter, RegExp, Sequ, Star, _labelT }
@@ -8,7 +8,7 @@
-package scala.util.regexp
+package scala.xml.dtd.impl
/**
* The class `WordExp` provides regular word expressions.
@@ -39,7 +39,7 @@ package scala.util.regexp
* @version 1.0
*/
@deprecated("This class will be removed", "2.10.0")
-abstract class WordExp extends Base {
+private[dtd] abstract class WordExp extends Base {
abstract class Label
@@ -1,5 +1,4 @@
-import scala.util.regexp.WordExp;
-import scala.util.automata.WordBerrySethi;
+package scala.xml.dtd.impl
object BoolWordExp extends WordExp {
type _labelT = MyLabels;
@@ -1,5 +1,6 @@
+package scala.xml.dtd.impl
+
import scala.collection._
-import scala.util.regexp._
abstract class S2 {
val lang: WordExp
View
@@ -1,17 +0,0 @@
-import scala.util.regexp.WordExp;
-import scala.util.automata.WordBerrySethi;
-
-object BoolWordExp extends WordExp {
- type _labelT = MyLabels;
- type _regexpT = RegExp;
- abstract class MyLabels extends Label ;
- case class MyLabel(c:Char) extends MyLabels;
-}
-
-object MyTranslator extends WordBerrySethi {
- override val lang = BoolWordExp;
- import lang._;
- override protected def seenLabel( r:RegExp, i:Int, label: _labelT ): Unit = {
- super.seenLabel(r,i,label)
- }
-}

0 comments on commit a9c374b

Please sign in to comment.