/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : IdlParser.h                                                   */
/* Author   : Tom O'Reilly                                                  */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#ifndef _IDLPARSER_H
#define _IDLPARSER_H

#include <stdio.h>
#include "idl.h"

class IdlParser {

public:

  IdlParser(FILE *idlFile);
  ~IdlParser();

  // Return 0 if parse error occurred
  Interface *nextInterface(bool *error);

  static int IdlParser::overloadCount(Interface *interface, 
				      const char *methodName);

  static DataDefinition *findDefinition(const char *name, Context *context,
					DynamicArray<Interface *> *interfaces);

  static DataDefinition *findDefinition(const char *name, Context *context);

  static void addComments(Base *base, DynamicArray<Comment *> *comments);

  static const char *buildContextPath(DynamicArray<char *> *pathNames);

  const char *errorMsg();

  // Re-initialize to parse next interface
  void reset();

protected:

  DynamicArray<Interface *> _interfaces;
  FILE *_idlFile;
};


// Prototypes
void restartLexer();

#endif
