gram
Safe HaskellSafe-Inferred
LanguageHaskell2010

Gram.CST

Synopsis

Documentation

data Gram Source #

Top-level Gram structure gram: optional(record) + repeat(annotated_pattern)

Instances

Instances details
Generic Gram Source # 
Instance details

Defined in Gram.CST

Associated Types

type Rep Gram 
Instance details

Defined in Gram.CST

type Rep Gram = D1 ('MetaData "Gram" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "Gram" 'PrefixI 'True) (S1 ('MetaSel ('Just "gramRecord") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Map String Value))) :*: S1 ('MetaSel ('Just "gramPatterns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [AnnotatedPattern])))

Methods

from :: Gram -> Rep Gram x #

to :: Rep Gram x -> Gram #

Show Gram Source # 
Instance details

Defined in Gram.CST

Methods

showsPrec :: Int -> Gram -> ShowS #

show :: Gram -> String #

showList :: [Gram] -> ShowS #

Eq Gram Source # 
Instance details

Defined in Gram.CST

Methods

(==) :: Gram -> Gram -> Bool #

(/=) :: Gram -> Gram -> Bool #

type Rep Gram Source # 
Instance details

Defined in Gram.CST

type Rep Gram = D1 ('MetaData "Gram" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "Gram" 'PrefixI 'True) (S1 ('MetaSel ('Just "gramRecord") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Map String Value))) :*: S1 ('MetaSel ('Just "gramPatterns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [AnnotatedPattern])))

data AnnotatedPattern Source #

A top-level annotated pattern annotated_pattern: optional(annotations) + single(pattern_element) Note: In tree-sitter-gram 0.2.7, annotated_pattern contains exactly ONE element. Comma-separated sequences only appear inside subject_pattern elements (after |).

Instances

Instances details
Generic AnnotatedPattern Source # 
Instance details

Defined in Gram.CST

Associated Types

type Rep AnnotatedPattern 
Instance details

Defined in Gram.CST

type Rep AnnotatedPattern = D1 ('MetaData "AnnotatedPattern" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "AnnotatedPattern" 'PrefixI 'True) (S1 ('MetaSel ('Just "apAnnotations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Annotation]) :*: S1 ('MetaSel ('Just "apElements") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PatternElement])))
Show AnnotatedPattern Source # 
Instance details

Defined in Gram.CST

Eq AnnotatedPattern Source # 
Instance details

Defined in Gram.CST

type Rep AnnotatedPattern Source # 
Instance details

Defined in Gram.CST

type Rep AnnotatedPattern = D1 ('MetaData "AnnotatedPattern" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "AnnotatedPattern" 'PrefixI 'True) (S1 ('MetaSel ('Just "apAnnotations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Annotation]) :*: S1 ('MetaSel ('Just "apElements") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PatternElement])))

data PatternElement Source #

Element of a pattern pattern_element: subject_pattern | path_pattern | pattern_reference

Instances

Instances details
Generic PatternElement Source # 
Instance details

Defined in Gram.CST

Associated Types

type Rep PatternElement 
Instance details

Defined in Gram.CST

Show PatternElement Source # 
Instance details

Defined in Gram.CST

Eq PatternElement Source # 
Instance details

Defined in Gram.CST

type Rep PatternElement Source # 
Instance details

Defined in Gram.CST

data Path Source #

A path structure (node connected by relationships) path_pattern: node_pattern | relationship_pattern This represents the linearized path: (a)-[r1]->(b)<-[r2]-(c)

Constructors

Path 

Instances

Instances details
Generic Path Source # 
Instance details

Defined in Gram.CST

Associated Types

type Rep Path 
Instance details

Defined in Gram.CST

type Rep Path = D1 ('MetaData "Path" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "Path" 'PrefixI 'True) (S1 ('MetaSel ('Just "pathStart") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Node) :*: S1 ('MetaSel ('Just "pathSegments") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PathSegment])))

Methods

from :: Path -> Rep Path x #

to :: Rep Path x -> Path #

Show Path Source # 
Instance details

Defined in Gram.CST

Methods

showsPrec :: Int -> Path -> ShowS #

show :: Path -> String #

showList :: [Path] -> ShowS #

Eq Path Source # 
Instance details

Defined in Gram.CST

Methods

(==) :: Path -> Path -> Bool #

(/=) :: Path -> Path -> Bool #

type Rep Path Source # 
Instance details

Defined in Gram.CST

type Rep Path = D1 ('MetaData "Path" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "Path" 'PrefixI 'True) (S1 ('MetaSel ('Just "pathStart") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Node) :*: S1 ('MetaSel ('Just "pathSegments") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PathSegment])))

data PathSegment Source #

A segment of a path: a relationship and the next node

Constructors

PathSegment 

Instances

Instances details
Generic PathSegment Source # 
Instance details

Defined in Gram.CST

Associated Types

type Rep PathSegment 
Instance details

Defined in Gram.CST

type Rep PathSegment = D1 ('MetaData "PathSegment" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "PathSegment" 'PrefixI 'True) (S1 ('MetaSel ('Just "segmentRel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Relationship) :*: S1 ('MetaSel ('Just "segmentNode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Node)))
Show PathSegment Source # 
Instance details

Defined in Gram.CST

Eq PathSegment Source # 
Instance details

Defined in Gram.CST

type Rep PathSegment Source # 
Instance details

Defined in Gram.CST

type Rep PathSegment = D1 ('MetaData "PathSegment" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "PathSegment" 'PrefixI 'True) (S1 ('MetaSel ('Just "segmentRel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Relationship) :*: S1 ('MetaSel ('Just "segmentNode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Node)))

data Node Source #

A node structure node_pattern: (subject?)

Constructors

Node 

Instances

Instances details
Generic Node Source # 
Instance details

Defined in Gram.CST

Associated Types

type Rep Node 
Instance details

Defined in Gram.CST

type Rep Node = D1 ('MetaData "Node" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "Node" 'PrefixI 'True) (S1 ('MetaSel ('Just "nodeSubject") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe SubjectData))))

Methods

from :: Node -> Rep Node x #

to :: Rep Node x -> Node #

Show Node Source # 
Instance details

Defined in Gram.CST

Methods

showsPrec :: Int -> Node -> ShowS #

show :: Node -> String #

showList :: [Node] -> ShowS #

Eq Node Source # 
Instance details

Defined in Gram.CST

Methods

(==) :: Node -> Node -> Bool #

(/=) :: Node -> Node -> Bool #

type Rep Node Source # 
Instance details

Defined in Gram.CST

type Rep Node = D1 ('MetaData "Node" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "Node" 'PrefixI 'True) (S1 ('MetaSel ('Just "nodeSubject") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe SubjectData))))

data Relationship Source #

A relationship structure relationship_pattern In CST, we capture the arrow and the optional subject

Instances

Instances details
Generic Relationship Source # 
Instance details

Defined in Gram.CST

Associated Types

type Rep Relationship 
Instance details

Defined in Gram.CST

type Rep Relationship = D1 ('MetaData "Relationship" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "Relationship" 'PrefixI 'True) (S1 ('MetaSel ('Just "relArrow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "relSubject") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe SubjectData))))
Show Relationship Source # 
Instance details

Defined in Gram.CST

Eq Relationship Source # 
Instance details

Defined in Gram.CST

type Rep Relationship Source # 
Instance details

Defined in Gram.CST

type Rep Relationship = D1 ('MetaData "Relationship" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "Relationship" 'PrefixI 'True) (S1 ('MetaSel ('Just "relArrow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "relSubject") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe SubjectData))))

data SubjectPattern Source #

A subject pattern structure (bracket notation) subject_pattern: [subject | elements]

Instances

Instances details
Generic SubjectPattern Source # 
Instance details

Defined in Gram.CST

Associated Types

type Rep SubjectPattern 
Instance details

Defined in Gram.CST

type Rep SubjectPattern = D1 ('MetaData "SubjectPattern" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "SubjectPattern" 'PrefixI 'True) (S1 ('MetaSel ('Just "spSubject") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe SubjectData)) :*: S1 ('MetaSel ('Just "spElements") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PatternElement])))
Show SubjectPattern Source # 
Instance details

Defined in Gram.CST

Eq SubjectPattern Source # 
Instance details

Defined in Gram.CST

type Rep SubjectPattern Source # 
Instance details

Defined in Gram.CST

type Rep SubjectPattern = D1 ('MetaData "SubjectPattern" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "SubjectPattern" 'PrefixI 'True) (S1 ('MetaSel ('Just "spSubject") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe SubjectData)) :*: S1 ('MetaSel ('Just "spElements") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PatternElement])))

data SubjectData Source #

Subject data container (Identifier, Labels, Record) Maps to subject in grammar

Instances

Instances details
Generic SubjectData Source # 
Instance details

Defined in Gram.CST

Associated Types

type Rep SubjectData 
Instance details

Defined in Gram.CST

type Rep SubjectData = D1 ('MetaData "SubjectData" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "SubjectData" 'PrefixI 'True) (S1 ('MetaSel ('Just "dataIdentifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Identifier)) :*: (S1 ('MetaSel ('Just "dataLabels") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set String)) :*: S1 ('MetaSel ('Just "dataProperties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map String Value)))))
Show SubjectData Source # 
Instance details

Defined in Gram.CST

Eq SubjectData Source # 
Instance details

Defined in Gram.CST

type Rep SubjectData Source # 
Instance details

Defined in Gram.CST

type Rep SubjectData = D1 ('MetaData "SubjectData" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "SubjectData" 'PrefixI 'True) (S1 ('MetaSel ('Just "dataIdentifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Identifier)) :*: (S1 ('MetaSel ('Just "dataLabels") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set String)) :*: S1 ('MetaSel ('Just "dataProperties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map String Value)))))

data Annotation Source #

Metadata annotation annotation: @key(value)

Constructors

Annotation 

Fields

Instances

Instances details
Generic Annotation Source # 
Instance details

Defined in Gram.CST

Associated Types

type Rep Annotation 
Instance details

Defined in Gram.CST

type Rep Annotation = D1 ('MetaData "Annotation" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "Annotation" 'PrefixI 'True) (S1 ('MetaSel ('Just "annKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Symbol) :*: S1 ('MetaSel ('Just "annValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)))
Show Annotation Source # 
Instance details

Defined in Gram.CST

Eq Annotation Source # 
Instance details

Defined in Gram.CST

type Rep Annotation Source # 
Instance details

Defined in Gram.CST

type Rep Annotation = D1 ('MetaData "Annotation" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "Annotation" 'PrefixI 'True) (S1 ('MetaSel ('Just "annKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Symbol) :*: S1 ('MetaSel ('Just "annValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)))

data Identifier Source #

Instances

Instances details
Generic Identifier Source # 
Instance details

Defined in Gram.CST

Associated Types

type Rep Identifier 
Instance details

Defined in Gram.CST

Show Identifier Source # 
Instance details

Defined in Gram.CST

Eq Identifier Source # 
Instance details

Defined in Gram.CST

Ord Identifier Source # 
Instance details

Defined in Gram.CST

type Rep Identifier Source # 
Instance details

Defined in Gram.CST

newtype Symbol Source #

Identifiers

Constructors

Symbol String 

Instances

Instances details
Generic Symbol Source # 
Instance details

Defined in Gram.CST

Associated Types

type Rep Symbol 
Instance details

Defined in Gram.CST

type Rep Symbol = D1 ('MetaData "Symbol" "Gram.CST" "gram-0.2.0-inplace" 'True) (C1 ('MetaCons "Symbol" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

Methods

from :: Symbol -> Rep Symbol x #

to :: Rep Symbol x -> Symbol #

Show Symbol Source # 
Instance details

Defined in Gram.CST

Eq Symbol Source # 
Instance details

Defined in Gram.CST

Methods

(==) :: Symbol -> Symbol -> Bool #

(/=) :: Symbol -> Symbol -> Bool #

Ord Symbol Source # 
Instance details

Defined in Gram.CST

type Rep Symbol Source # 
Instance details

Defined in Gram.CST

type Rep Symbol = D1 ('MetaData "Symbol" "Gram.CST" "gram-0.2.0-inplace" 'True) (C1 ('MetaCons "Symbol" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

type Value = Value Source #

Values (mirroring Subject.Value but local to CST if needed, or we can reuse Core types if they are purely data) NOTE: These type aliases are kept for potential future use.