This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class Tree(var left: Tree, var right: Tree, var value: Int) | |
def build(seq: Seq[Int]): Tree = seq match { | |
case Nil => null | |
case _ => | |
import scala.util.Random | |
val pos = Random nextInt seq.length | |
val (left, right) = seq splitAt pos | |
Tree(build(left), build(right.tail), right.head) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// _[@type=="baoc" and ts10[@value=="1" and a==2] and ts20] | |
package com.honnix.xml.transformer | |
import scala.xml.NodeSeq | |
import scala.util.parsing.combinator.JavaTokenParsers | |
object XPathParser { | |
def apply(conditionalPath: String, topSelector: (NodeSeq, String) => NodeSeq) = | |
new XPathParser(conditionalPath, topSelector) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ericsson.asn12schema.transformer | |
import scala.xml.{UnprefixedAttribute, Null} | |
import com.honnix.asn12schema.model.datatype.complex.{ASN1EnumeratedType, ASN1SetField, ASN1SetOfType, ASN1SetType} | |
import com.honnix.asn12schema.model.ASN1Module | |
import com.honnix.asn12schema.model.datatype.primitive.{ASN1PrimitiveType, ASN1BooleanType, ASN1IA5StringType, ASN1IntegerType} | |
class DefaultTransformer extends Transformer { | |
private def dealWithIntOrString(field: ASN1SetField) = { |
NewerOlder