harmony-0.1.0.2: A web service specification compiler that generates implementation and tests.

Safe HaskellNone
LanguageHaskell2010

LangUtils

Description

Contains useful methods to work with the defined types (both from the language specification/bnfc and the ApiSpec module).

Synopsis

Documentation

specName Source

Arguments

:: Specification

Specification returned by the parser

-> String

Name of the specification

Extracts the name of the Specification (AST).

specVersion Source

Arguments

:: Specification

Specification returned by the parser

-> String

Version of the specification

Extracts the version of the Specification (AST).

enumName Source

Arguments

:: EnumType

Enum information

-> String

Name of the enum type

Extracts the name of an enum.

enumVals Source

Arguments

:: EnumType

Enum information

-> [EnumVal]

List of enum values

Extracts the values of an enum.

enumValName Source

Arguments

:: EnumVal

Enum value information

-> String

Identifier of the enum value

strName Source

Arguments

:: StructType

The struct info

-> String

The name of the struct

Extracts the name of a struct.

strFields Source

Arguments

:: StructType

Struct info

-> [Field]

List of fields of the struct

Extracts the fields of a struct.

resName Source

Arguments

:: Resource

Resource information

-> String

Name of the resource

Extracts the name of a resource.

resRoute Source

Arguments

:: Resource

Resource information

-> String

Route of the resource

Extracts the route of a resource.

resIsWritable Source

Arguments

:: Resource

Resource information

-> Bool

True if it is writable, False otherwise

Extracts the write mode of a resource.

fieldName Source

Arguments

:: Field

Field information

-> String

Name of the field

Extracts the name of a field.

fieldAnnotations Source

Arguments

:: Field

Field information

-> [Annotation]

List of annotations

Extracts the annotation of a field.

fieldType Source

Arguments

:: Field

Field information

-> FType

Type of the field

Extracts the type (defined by the language specification/bnfc) of a field.

fieldSpecType Source

Arguments

:: (Set String, Set String)

(Struct names, Enum names)

-> FType

Field type

-> Type

ApiSpec field type

Extracts the type (defined in ApiSpec) of a field.