// file: $isip/class/pr/LanguageModelXML/lmxml_00.cc
// version: $Id: lmxml_00.cc 10156 2005-07-13 17:17:43Z wholland $

// ISIP include files
//
#include "LanguageModelXML.h"

// constant: class name
//
const String LanguageModelXML::CLASS_NAME(L"LanguageModelXML");

// constants: file parameters
//
const String LanguageModelXML::DEF_PARAM(String::EMPTY);
const long LanguageModelXML::DEF_LEVEL = -1;
const String LanguageModelXML::PARAM_GRAMMARS(L"grammars");
const long LanguageModelXML::DEF_TAG = 0;

// the default weight to be applied to all arcs
//
const float LanguageModelXML::DEF_WEIGHT = 1.0;

// used when appending level index to definition parameter
//
const String LanguageModelXML::PARAM_UNDERSCORE(L"_");

// prefix for context label used when defining subgraph of context
//
const String LanguageModelXML::CONTEXT_LABEL_PREFIX(L"G_");

// constant: character used to delimit symbols within a context
//
const String LanguageModelXML::CONTEXT_SYMBOL_DELIM(L"-");

// constants: special rule definitions
//
const String LanguageModelXML::SPECIAL_GARBAGE(L"GARBAGE");
const String LanguageModelXML::SPECIAL_VOID(L"VOID");
const String LanguageModelXML::SPECIAL_NULL(L"NULL");

// constants: valid xml token types
//
const String LanguageModelXML::ONE_OF(L"one-of");
const String LanguageModelXML::ITEM(L"item");
const String LanguageModelXML::RULEREF(L"ruleref");
const String LanguageModelXML::RULE(L"rule");
const String LanguageModelXML::GRAMMAR(L"grammar");

// constants: supported xml attributes
//
const String LanguageModelXML::WEIGHT(L"weight");
const String LanguageModelXML::REPEAT(L"repeat");
const String LanguageModelXML::REPEAT_PROB(L"repeat-prob");
const String LanguageModelXML::ROOT(L"root");
const String LanguageModelXML::URI(L"uri");
const String LanguageModelXML::SPECIAL(L"special");
const String LanguageModelXML::ID(L"id");

// constants: strings occuring in attribute values
//
const String LanguageModelXML::RULEREF_URI_LOCAL_DELIM(L"#");
const String LanguageModelXML::REPEAT_RANGE_DELIM(L"-");
const String LanguageModelXML::REPEAT_LOOP_BACK(L"1-");

// constant: isip dummy tag
// 
const String LanguageModelXML::ISIP_DUMMY_NODE(L"isip_rule_null");

// constants: output grammar strings
//
const String LanguageModelXML::XML_VERSION_TAG(L"<?xml version='1.0' encoding='utf-8'?>");
const String LanguageModelXML::ROOT_ATTRIB(L"root");
const String LanguageModelXML::ID_ATTRIB(L"id");
const long LanguageModelXML::LOOP_BACK = 0;
const String LanguageModelXML::ALGORITHM(L"algorithm");
const String LanguageModelXML::XML(L"XML");
const String LanguageModelXML::IMPLEMENTATION(L"implementation");
const String LanguageModelXML::IHD(L"IHD");
const long LanguageModelXML::TERMINAL_INDEX = -2;
const long LanguageModelXML::START_INDEX = -1;

// method: default constructor
//
// arguments: none
//
// return: none
//
LanguageModelXML::LanguageModelXML () {
  
  // this variable tracks and makes possible parsing of nested rules.
  // 
  rule_nesting_level_d = 0;
  
  // set the debug level
  //
  debug_level_d = Integral::NONE;
}
