compiler/Dart__ParserContext.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 04 Nov 2014 00:31:38 +0000
changeset 10 5df5a2f8e4b5
permissions -rw-r--r--
Updated to work with recent PetitParser

"{ Package: 'ctu:dart/compiler' }"

"{ NameSpace: Dart }"

PPContext subclass:#ParserContext
	instanceVariableNames:'scanner'
	classVariableNames:''
	poolDictionaries:''
	category:'Languages-Dart-Parser'
!

!ParserContext methodsFor:'accessing'!

stream: aStream
    super stream: aStream.
    scanner := Scanner for: aStream.

    "Created: / 04-11-2014 / 00:26:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ParserContext methodsFor:'accessing - tokens'!

token
    ^ scanner token

    "Created: / 04-11-2014 / 00:28:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

tokenType
    ^ scanner tokenType

    "Created: / 04-11-2014 / 00:27:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

tokenValue
    ^ scanner tokenValue

    "Created: / 04-11-2014 / 00:28:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!ParserContext methodsFor:'streaming - tokens'!

nextToken
    ^ scanner nextToken

    "Created: / 04-11-2014 / 00:27:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !