PPEndOfFileParser.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 07 Sep 2015 11:53:38 +0100
changeset 538 16e8536f5cfb
parent 427 a7f5e6de19d2
permissions -rw-r--r--
PPCConfiguration refactoring: [10/10]: Cleaned up compilation API The main compilation method is now PPParser>>compileWithOptions: Removed oither old and unused compilation methods from PPParser and other PetitCompiler classes.

"{ Package: 'stx:goodies/petitparser' }"

"{ NameSpace: Smalltalk }"

PPParser subclass:#PPEndOfFileParser
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'PetitParser-Parsers'
!

!PPEndOfFileParser methodsFor:'as yet unclassified'!

acceptsEpsilon
	^ true
!

exampleOn: aStream 
	aStream nextPutAll: #'end-of-input'
!

isNullable 
	^ true
!

nonEmpty
	"I know I am empty, but it does not count in my case, I represent virtual non-existent character"
	^ self
!

parseOn: aPPContext
	(aPPContext atEnd) ifFalse:
	[
		^ PPFailure message: 'end of input expected' context: aPPContext.
	].
	^ #'end-of-input'
! !