Skip to content

Commit

Permalink
Merge pull request #186 from tkw1536/scscp
Browse files Browse the repository at this point in the history
Implement an SCSCPServer component
  • Loading branch information
Jazzpirate committed Jan 24, 2017
2 parents 1402b22 + 177a9fc commit 5da5447
Show file tree
Hide file tree
Showing 19 changed files with 841 additions and 263 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ class OMXMLCoding extends OMCoding[Node] {
val id = getOAttr(v, ATTR_ID)

OMString(text, id)
case <OMSTR></OMSTR> =>
val id = getOAttr(v, ATTR_ID)
OMString("", id)
case <OMB>{bNode : Text}</OMB> =>
val bytes = OMCoding.hex2Bytes(bNode.text)

Expand Down
14 changes: 14 additions & 0 deletions src/mmt-odk/src/info/kwarc/mmt/odk/SCSCP/CD/logic1.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package info.kwarc.mmt.odk.SCSCP.CD

import info.kwarc.mmt.odk.OpenMath.OMSymbol


object logic1 {
/* The name of the cd itself */
def apply(name: String) = {
OMSymbol(name, "scscp1", None, None)
}

final val True: String = "true"
final val False: String = "false"
}
36 changes: 18 additions & 18 deletions src/mmt-odk/src/info/kwarc/mmt/odk/SCSCP/CD/scscp1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ import info.kwarc.mmt.odk.OpenMath.OMSymbol
object scscp1 {

/* The name of the cd itself */
def apply(name : String) = {
def apply(name: String) = {
OMSymbol(name, "scscp1", None, None)
}

/* Main Messages */
val procedureCall = "procedure_call"
val procedureCompleted = "procedure_completed"
val procedureTerminated = "procedure_terminated"
final val procedureCall: String = "procedure_call"
final val procedureCompleted: String = "procedure_completed"
final val procedureTerminated = "procedure_terminated"

/* Call and Response Identifiers */
val callId = "call_id"
final val callId = "call_id"

/* Options in procedure calls */
val optionMaxMemory = "option_max_memory"
val optionMinMemory = "option_min_memory"
val optionRuntime = "option_runtime"
val optionDebugLevel = "option_debuglevel"
val optionReturnCookie = "option_return_cookie"
val optionReturnObject = "option_return_object"
val optionReturnNothing = "option_return_nothing"
final val optionMaxMemory = "option_max_memory"
final val optionMinMemory = "option_min_memory"
final val optionRuntime = "option_runtime"
final val optionDebugLevel = "option_debuglevel"
final val optionReturnCookie = "option_return_cookie"
final val optionReturnObject = "option_return_object"
final val optionReturnNothing = "option_return_nothing"

/* Information attributes */
val infoMemory = "info_memory"
val infoRuntime = "info_runtime"
val infoMessage = "info_message"
final val infoMemory = "info_memory"
final val infoRuntime = "info_runtime"
final val infoMessage = "info_message"

/* Standard errors */
val errorMemory = "error_memory"
val errorRuntime = "error_runtime"
val errorSystemSpecific = "error_system_specific"
final val errorMemory = "error_memory"
final val errorRuntime = "error_runtime"
final val errorSystemSpecific = "error_system_specific"
}
31 changes: 21 additions & 10 deletions src/mmt-odk/src/info/kwarc/mmt/odk/SCSCP/CD/scscp2.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package info.kwarc.mmt.odk.SCSCP.CD

import info.kwarc.mmt.odk.OpenMath.OMSymbol
import info.kwarc.mmt.odk.OpenMath.{OMApplication, OMExpression, OMObject, OMSymbol}

object scscp2 {

Expand All @@ -10,22 +10,33 @@ object scscp2 {
}

/* Procedures for work with remote objects */
val storeSession = "store_session"
val storePersistent = "store_persistent"
val retrieve = "retrieve"
val unbind = "unbind"
final val storeSession = "store_session"
final val storePersistent = "store_persistent"
final val retrieve = "retrieve"
final val unbind = "unbind"

/* Special procedures to obtain meta-information about SCSCP service */
val getAllowedHeads = "get_allowed_heads"
val isAllowedHead = "is_allowed_head"
val getTransientCD = "get_transient_cd"
val getSignature = "get_signature"
val getServiceDescription = "get_service_description"
final val getAllowedHeads = "get_allowed_heads"
final val isAllowedHead = "is_allowed_head"
final val getTransientCD = "get_transient_cd"
final val getSignature = "get_signature"
final val getServiceDescription = "get_service_description"

/* Special symbols */
val signature = "signature"
val serviceDescription = "service_description"
val symbolSet = "symbol_set"

val symbolSetAll = "symbol_set_all"
val noSuchTransientCD = "no_such_transient_cd"
}

object SymbolSet {
def apply(elements : List[OMExpression]) : OMApplication = {
OMApplication(scscp2(scscp2.symbolSet), elements, None, None)
}
def unapply(oma : OMApplication) : Option[List[OMExpression]] = oma match {
case OMApplication(ss, elements, _, _) if ss == scscp2(scscp2.symbolSet) => Some(elements)
case _ => None
}
}
Loading

0 comments on commit 5da5447

Please sign in to comment.