/* Copyright (c) 2013 The Chromium Authors. All rights reserved.
   Use of this source code is governed by a BSD-style license that can be
  found in the LICENSE file. */

/* Test Typedef productions

Run with --test to generate an AST and verify that all comments accurately
reflect the state of the Nodes.

BUILD Type(Name)
This comment signals that a node of type <Type> is created with the
name <Name>.

ERROR Error String
This comment signals that a error of <Error String> is generated.  The error
is not assigned to a node, but are expected in order.

PROP Key=Value
This comment signals that a property has been set on the Node such that
<Key> = <Value>.

TREE
Type(Name)
  Type(Name)
  Type(Name)
    Type(Name)
    ...
This comment signals that a tree of nodes matching the BUILD comment
symatics should exist.  This is an exact match.
*/


/** TREE
 *Typedef(MyLong)
 *  Type()
 *    PrimitiveType(long)
 */
typedef long MyLong;

/** TREE
 *Typedef(MyLong)
 *  ExtAttributes()
 *    ExtAttribute(foo)
 *  Type()
 *    PrimitiveType(long)
 */
typedef [foo] long MyLong;

/** TREE
 *Typedef(MyLongArray)
 *  Type()
 *    PrimitiveType(long)
 *    Array()
 */
typedef long[] MyLongArray;

/** TREE
 *Typedef(MyLongSizedArray)
 *  Type()
 *    PrimitiveType(long)
 *    Array(4)
 */
typedef long[4] MyLongSizedArray;

/** TREE
 *Typedef(MyLongSizedArrayArray)
 *  Type()
 *    PrimitiveType(long)
 *    Array(4)
 *      Array(5)
 */
typedef long[4][5] MyLongSizedArrayArray;

/** TREE
 *Typedef(MyLongArraySizedArray)
 *  Type()
 *    PrimitiveType(long)
 *    Array()
 *      Array(5)
 */
typedef long[][5] MyLongArraySizedArray;

/** TREE
 *Typedef(MyTypeFive)
 *  Type()
 *    Typeref(MyType)
 *    Array(5)
 */
typedef MyType[5] MyTypeFive;

/** TREE
 *Typedef(MyTypeUnsizedFive)
 *  Type()
 *    Typeref(MyType)
 *    Array()
 *      Array(5)
 */
typedef MyType[][5] MyTypeUnsizedFive;

/** TREE
 *Typedef(MyLongLong)
 *  Type()
 *    PrimitiveType(long long)
 */
typedef long long MyLongLong;

/** TREE
 *Typedef(MyULong)
 *  Type()
 *    PrimitiveType(unsigned long)
 */
typedef unsigned long MyULong;

/** TREE
 *Typedef(MyULongLong)
 *  Type()
 *    PrimitiveType(unsigned long long)
 */
typedef unsigned long long MyULongLong;

/** TREE
 *Typedef(MyString)
 *  Type()
 *    StringType(DOMString)
 */
typedef DOMString MyString;

/** TREE
 *Typedef(MyObject)
 *  Type()
 *    PrimitiveType(object)
 */
typedef object MyObject;

/** TREE
 *Typedef(MyDate)
 *  Type()
 *    PrimitiveType(Date)
 */
typedef Date MyDate;

/** TREE
 *Typedef(MyFloat)
 *  Type()
 *    PrimitiveType(float)
 */
typedef float MyFloat;

/** TREE
 *Typedef(MyUFloat)
 *  Type()
 *    PrimitiveType(float)
 */
typedef unrestricted float MyUFloat;

/** TREE
 *Typedef(MyDouble)
 *  Type()
 *    PrimitiveType(double)
 */
typedef double MyDouble;

/** TREE
 *Typedef(MyUDouble)
 *  Type()
 *    PrimitiveType(double)
 */
typedef unrestricted double MyUDouble;

/** TREE
 *Typedef(MyBool)
 *  Type()
 *    PrimitiveType(boolean)
 */
typedef boolean MyBool;

/** TREE
 *Typedef(MyByte)
 *  Type()
 *    PrimitiveType(byte)
 */
typedef byte MyByte;

/** TREE
 *Typedef(MyOctet)
 *  Type()
 *    PrimitiveType(octet)
 */
typedef octet MyOctet;

/** TREE
 *Typedef(MyRecord)
 *  Type()
 *    Record()
 *      StringType(ByteString)
 *      Type()
 *        Typeref(int)
 */
typedef record<ByteString, int> MyRecord;

/** TREE
 *Typedef(MyInvalidRecord)
 *  Type()
 *    Error(Unexpected keyword "double" after "<".)
 */
typedef record<double, ByteString> MyInvalidRecord;
