package Cobol::Compiler::COBOLMainLexer;

### This class just parser-lexes the COBOL main functionality of the file

use parent 'Lexer';
use feature "switch";

use constant MAIN => qw(IDENTIFICATION PROGRAM-ID);

sub new {
	my ($class) = @_;

	my $self = { 
		mastersymtab =>	Cobol::Compiler::COBOLMasterSymbolTable->new, 
	};

	$class = ref($class) || $class;

	bless $self, $class;
}

sub switch {
	my ($self, $s) = @_;

	### return references to keywords in symbol table
	given ($s) {
	when (Cobol::Compiler::COBOLMainLexer->IDENTIFICATION) { 
		return \$self->{mastersymtab}->{IDENTIFICATION}	
	}
	when (Cobol::Compiler::COBOLMainLexer->PROGRAM-ID) {  }
		return \$self->{mastersymtab}->{IDENTIFICATION}	
	}
	return nil;
}

1;
