-
comby
-
-
comby.configuration
-
comby.interactive
-
comby.patdiff
-
comby.patdiff_kernel
-
-
comby.pipeline
-
comby.statistics
Library
Module
Module type
Parameter
Class
Class type
Metasyntax
Defines the metasyntax recognized in templates and associates the metasyntax with the matching behavior of holes.
aliases where a match of the string pattern
maps to match_template
and rule
.
A hole definition should comprise either a string prefix, suffix, or both which encloses an variable identifier. See example below.
Defines syntax definitions for holes. Zero or more Hole sorts, excluding Regex
should have an associated hole_definition
. The Regex
hole must define a prefix, separator, and suffix. See example below.
A metasyntax comprises:
identifier
where the list of characters are allowed in identifiers. For example, to allow only contiguous capitalized letters as recognized identifiers within some hole syntax, use:
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
syntax
with one or more hole definitions. For example, the default metasyntax for theEverything
hole is defined as:
Hole (Everything, Delimited (Some ":[", Some "]"))
A Regex hole must define a prefix, separator, and suffix. The current convention is taken to parse Regex holes as:
<prefix><identifier><separator><regular expression><suffix>
A separator is required to syntactically distinguish arbitrary identifier syntax from regular exressions. A suffix is required to syntactically distinguish when to stop parsing a regular expression and resume parsing the rest of the template.
val to_yojson : t -> Yojson.Safe.json
val of_yojson : Yojson.Safe.json -> (t, string) Core_kernel.Result.t
module type S = sig ... end
A module signature for metasyntax to parameterize a matcher
val default_metasyntax : t
The default metasyntax. It is defined as:
let default_syntax = Hole (Everything, Delimited (Some ":[", Some "]"))
; Hole (Expression, Delimited (Some ":[", Some ":e]"))
; Hole (Alphanum, Delimited (Some ":[[", Some "]]"))
; Hole (Non_space, Delimited (Some ":[", Some ".]"))
; Hole (Line, Delimited (Some ":[", Some "\\n]"))
; Hole (Blank, Delimited (Some ":[ ", Some "]"))
; Regex (":[", '~', "]")
let default_identifier = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
val json : t -> string
A JSON representation of the metasyntax defintion
val default : (module S)
default
returns the default metasyntax module