| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Gram.CST
Synopsis
- data Gram = Gram {
- gramRecord :: Maybe (Map String Value)
- gramPatterns :: [AnnotatedPattern]
- data AnnotatedPattern = AnnotatedPattern {
- apAnnotations :: [Annotation]
- apElements :: [PatternElement]
- data PatternElement
- data Path = Path {
- pathStart :: Node
- pathSegments :: [PathSegment]
- data PathSegment = PathSegment {}
- data Node = Node {}
- data Relationship = Relationship {}
- data SubjectPattern = SubjectPattern {}
- data SubjectData = SubjectData {}
- data Annotation = Annotation {}
- data Identifier
- newtype Symbol = Symbol String
- type Value = Value
- type RangeValue = RangeValue
Documentation
Top-level Gram structure gram: optional(record) + repeat(annotated_pattern)
Constructors
| Gram | |
Fields
| |
Instances
| Generic Gram Source # | |||||
Defined in Gram.CST Associated Types
| |||||
| Show Gram Source # | |||||
| Eq Gram Source # | |||||
| type Rep Gram Source # | |||||
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 |).
Constructors
| AnnotatedPattern | |
Fields
| |
Instances
data PatternElement Source #
Element of a pattern pattern_element: subject_pattern | path_pattern | pattern_reference
Constructors
| PEPath Path | |
| PESubjectPattern SubjectPattern | |
| PEReference Identifier |
Instances
| Generic PatternElement Source # | |||||
Defined in Gram.CST Associated Types
Methods from :: PatternElement -> Rep PatternElement x # to :: Rep PatternElement x -> PatternElement # | |||||
| Show PatternElement Source # | |||||
Defined in Gram.CST Methods showsPrec :: Int -> PatternElement -> ShowS # show :: PatternElement -> String # showList :: [PatternElement] -> ShowS # | |||||
| Eq PatternElement Source # | |||||
Defined in Gram.CST Methods (==) :: PatternElement -> PatternElement -> Bool # (/=) :: PatternElement -> PatternElement -> Bool # | |||||
| type Rep PatternElement Source # | |||||
Defined in Gram.CST type Rep PatternElement = D1 ('MetaData "PatternElement" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "PEPath" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Path)) :+: (C1 ('MetaCons "PESubjectPattern" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SubjectPattern)) :+: C1 ('MetaCons "PEReference" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier)))) | |||||
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 | |
Fields
| |
Instances
| Generic Path Source # | |||||
Defined in Gram.CST Associated Types
| |||||
| Show Path Source # | |||||
| Eq Path Source # | |||||
| type Rep Path Source # | |||||
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 | |
Fields | |
Instances
| Generic PathSegment Source # | |||||
Defined in Gram.CST Associated Types
| |||||
| Show PathSegment Source # | |||||
Defined in Gram.CST Methods showsPrec :: Int -> PathSegment -> ShowS # show :: PathSegment -> String # showList :: [PathSegment] -> ShowS # | |||||
| Eq PathSegment Source # | |||||
Defined in Gram.CST | |||||
| type Rep PathSegment Source # | |||||
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))) | |||||
A node structure node_pattern: (subject?)
Constructors
| Node | |
Fields | |
Instances
| Generic Node Source # | |
Defined in Gram.CST | |
| Show Node Source # | |
| Eq Node Source # | |
| type Rep Node Source # | |
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
Constructors
| Relationship | |
Fields
| |
Instances
| Generic Relationship Source # | |||||
Defined in Gram.CST Associated Types
| |||||
| Show Relationship Source # | |||||
Defined in Gram.CST Methods showsPrec :: Int -> Relationship -> ShowS # show :: Relationship -> String # showList :: [Relationship] -> ShowS # | |||||
| Eq Relationship Source # | |||||
Defined in Gram.CST | |||||
| type Rep Relationship Source # | |||||
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]
Constructors
| SubjectPattern | |
Fields | |
Instances
| Generic SubjectPattern Source # | |||||
Defined in Gram.CST Associated Types
Methods from :: SubjectPattern -> Rep SubjectPattern x # to :: Rep SubjectPattern x -> SubjectPattern # | |||||
| Show SubjectPattern Source # | |||||
Defined in Gram.CST Methods showsPrec :: Int -> SubjectPattern -> ShowS # show :: SubjectPattern -> String # showList :: [SubjectPattern] -> ShowS # | |||||
| Eq SubjectPattern Source # | |||||
Defined in Gram.CST Methods (==) :: SubjectPattern -> SubjectPattern -> Bool # (/=) :: SubjectPattern -> SubjectPattern -> Bool # | |||||
| type Rep SubjectPattern Source # | |||||
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
Constructors
| SubjectData | |
Fields | |
Instances
| Generic SubjectData Source # | |||||
Defined in Gram.CST Associated Types
| |||||
| Show SubjectData Source # | |||||
Defined in Gram.CST Methods showsPrec :: Int -> SubjectData -> ShowS # show :: SubjectData -> String # showList :: [SubjectData] -> ShowS # | |||||
| Eq SubjectData Source # | |||||
Defined in Gram.CST | |||||
| type Rep SubjectData Source # | |||||
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 | |
Instances
| Generic Annotation Source # | |||||
Defined in Gram.CST Associated Types
| |||||
| Show Annotation Source # | |||||
Defined in Gram.CST Methods showsPrec :: Int -> Annotation -> ShowS # show :: Annotation -> String # showList :: [Annotation] -> ShowS # | |||||
| Eq Annotation Source # | |||||
Defined in Gram.CST | |||||
| type Rep Annotation Source # | |||||
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 #
Constructors
| IdentSymbol Symbol | |
| IdentString String | |
| IdentInteger Integer |
Instances
| Generic Identifier Source # | |||||
Defined in Gram.CST Associated Types
| |||||
| Show Identifier Source # | |||||
Defined in Gram.CST Methods showsPrec :: Int -> Identifier -> ShowS # show :: Identifier -> String # showList :: [Identifier] -> ShowS # | |||||
| Eq Identifier Source # | |||||
Defined in Gram.CST | |||||
| Ord Identifier Source # | |||||
Defined in Gram.CST Methods compare :: Identifier -> Identifier -> Ordering # (<) :: Identifier -> Identifier -> Bool # (<=) :: Identifier -> Identifier -> Bool # (>) :: Identifier -> Identifier -> Bool # (>=) :: Identifier -> Identifier -> Bool # max :: Identifier -> Identifier -> Identifier # min :: Identifier -> Identifier -> Identifier # | |||||
| type Rep Identifier Source # | |||||
Defined in Gram.CST type Rep Identifier = D1 ('MetaData "Identifier" "Gram.CST" "gram-0.2.0-inplace" 'False) (C1 ('MetaCons "IdentSymbol" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Symbol)) :+: (C1 ('MetaCons "IdentString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "IdentInteger" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))) | |||||
Identifiers
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.
type RangeValue = RangeValue Source #