A declaration is used to specify a graph structure with multiple sorts of labeled nodes and labeled directed edges. Attributes can be attached to both nodes and edges. The syntax of graphtype declarations is as follows:
Graph_Type ::=graphtype Id [ : Inherit_List ] [ :: Graph_Mode ¼ Graph_Mode ] declare node: Node_Def - ¼ - Node_Def edge: Edge_Def - ¼ - Edge_Def begin Code end graphtype ; Graph_Mode ::= Node_Def ::=Id [ [ of ] TypeExp ] Edge_Def ::=Id [ of ] Type_Exp -> Type_Exp | Id [ of ] Type_Exp <-> Type_Exp | Id [ of ] Type_Exp <=> Type_Exp | Id [ of ] Type_Exp <=>* Type_Exp