package osa.attribute.atgrammar.grammar;

import java.util.*;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: </p>
 * <p>Company: </p>
 * @author not attributable
 * @version
 */

public class LexicalAnalyser
  {
  protected class State
    {
    String symbo_name;
    }

  protected class InputSymbol
    {
    Character value;
    }

  protected class EndState
    {
    String symbo_name;
    }

  protected TreeMap StatesDictionary;
  protected TreeMap EndStatesDictionary;


  protected class StateTransition
    {

    }

  protected String text_representation="";

  protected int position;
  protected int lines_counter;

  ArrayList error_messages=new ArrayList();

  public LexicalAnalyser(String text_representation)
    {
    this.text_representation=text_representation;
    }

  public LexicalAnalyser()
    {

    }

  public void buildAutomaton()
    {
    position=0;
    lines_counter=0;
    if(getNextChar()==null)
      {
      return;
      }
    }


  public void needStateTransition()
    {

    }



/*  public void needComment()
    {
    if(getNextChar().charValue()!='-')
      {
//      add
      }
    }*/

  public Character getNextChar()
    {
    position++;
    if(position>=text_representation.length())
      {
      return null;
      }
    return new Character(text_representation.charAt(position));
    }

  public Character getCurrentChar()
    {
    if(position>=text_representation.length())
      {
      return null;
      }
    return new Character(text_representation.charAt(position));
    }



  }