Updated to work with recent PetitParser default tip
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 04 Nov 2014 00:31:38 +0000
changeset 105df5a2f8e4b5
parent 9 ae0dabfd3321
Updated to work with recent PetitParser
compiler/Dart__Parser.st
compiler/Dart__ParserContext.st
compiler/Make.proto
compiler/Make.spec
compiler/abbrev.stc
compiler/bc.mak
compiler/compiler.rc
compiler/ctu_dart_compiler.st
compiler/libInit.cc
     1.1 --- a/compiler/Dart__Parser.st	Tue Nov 04 00:18:07 2014 +0000
     1.2 +++ b/compiler/Dart__Parser.st	Tue Nov 04 00:31:38 2014 +0000
     1.3 @@ -1,4 +1,4 @@
     1.4 -"{ Package: 'jv:dart/compiler' }"
     1.5 +"{ Package: 'ctu:dart/compiler' }"
     1.6  
     1.7  "{ NameSpace: Dart }"
     1.8  
     1.9 @@ -983,6 +983,16 @@
    1.10      "Modified: / 11-01-2013 / 11:35:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.11  ! !
    1.12  
    1.13 +!Parser methodsFor:'parsing'!
    1.14 +
    1.15 +parse: anObject
    1.16 +        "Parse anObject with the receiving parser and answer the parse-result or an instance of PPFailure."
    1.17 +
    1.18 +        ^ self parse: anObject withContext: ParserContext new
    1.19 +
    1.20 +    "Created: / 04-11-2014 / 00:23:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.21 +! !
    1.22 +
    1.23  !Parser::TokenParser class methodsFor:'instance creation'!
    1.24  
    1.25  for: tokenType
    1.26 @@ -1030,4 +1040,5 @@
    1.27      ^ '$Changeset: <not expanded> $'
    1.28  ! !
    1.29  
    1.30 +
    1.31  Parser initialize!
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/compiler/Dart__ParserContext.st	Tue Nov 04 00:31:38 2014 +0000
     2.3 @@ -0,0 +1,48 @@
     2.4 +"{ Package: 'ctu:dart/compiler' }"
     2.5 +
     2.6 +"{ NameSpace: Dart }"
     2.7 +
     2.8 +PPContext subclass:#ParserContext
     2.9 +	instanceVariableNames:'scanner'
    2.10 +	classVariableNames:''
    2.11 +	poolDictionaries:''
    2.12 +	category:'Languages-Dart-Parser'
    2.13 +!
    2.14 +
    2.15 +!ParserContext methodsFor:'accessing'!
    2.16 +
    2.17 +stream: aStream
    2.18 +    super stream: aStream.
    2.19 +    scanner := Scanner for: aStream.
    2.20 +
    2.21 +    "Created: / 04-11-2014 / 00:26:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    2.22 +! !
    2.23 +
    2.24 +!ParserContext methodsFor:'accessing - tokens'!
    2.25 +
    2.26 +token
    2.27 +    ^ scanner token
    2.28 +
    2.29 +    "Created: / 04-11-2014 / 00:28:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    2.30 +!
    2.31 +
    2.32 +tokenType
    2.33 +    ^ scanner tokenType
    2.34 +
    2.35 +    "Created: / 04-11-2014 / 00:27:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    2.36 +!
    2.37 +
    2.38 +tokenValue
    2.39 +    ^ scanner tokenValue
    2.40 +
    2.41 +    "Created: / 04-11-2014 / 00:28:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    2.42 +! !
    2.43 +
    2.44 +!ParserContext methodsFor:'streaming - tokens'!
    2.45 +
    2.46 +nextToken
    2.47 +    ^ scanner nextToken
    2.48 +
    2.49 +    "Created: / 04-11-2014 / 00:27:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    2.50 +! !
    2.51 +
     3.1 --- a/compiler/Make.proto	Tue Nov 04 00:18:07 2014 +0000
     3.2 +++ b/compiler/Make.proto	Tue Nov 04 00:31:38 2014 +0000
     3.3 @@ -124,6 +124,7 @@
     3.4  
     3.5  # BEGINMAKEDEPEND --- do not remove this line; make depend needs it
     3.6  $(OUTDIR)Dart__Parser.$(O) Dart__Parser.$(H): Dart__Parser.st $(INCLUDE_TOP)/stx/goodies/petitparser/PPCompositeParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPDelegateParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPParser.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
     3.7 +$(OUTDIR)Dart__ParserContext.$(O) Dart__ParserContext.$(H): Dart__ParserContext.st $(INCLUDE_TOP)/stx/goodies/petitparser/PPContext.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
     3.8  $(OUTDIR)Dart__ParserError.$(O) Dart__ParserError.$(H): Dart__ParserError.st $(INCLUDE_TOP)/stx/libbasic/Error.$(H) $(INCLUDE_TOP)/stx/libbasic/Exception.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
     3.9  $(OUTDIR)Dart__ScannerBase.$(O) Dart__ScannerBase.$(H): Dart__ScannerBase.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
    3.10  $(OUTDIR)ctu_dart_compiler.$(O) ctu_dart_compiler.$(H): ctu_dart_compiler.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(STCHDR)
     4.1 --- a/compiler/Make.spec	Tue Nov 04 00:18:07 2014 +0000
     4.2 +++ b/compiler/Make.spec	Tue Nov 04 00:31:38 2014 +0000
     4.3 @@ -51,6 +51,7 @@
     4.4  
     4.5  COMMON_CLASSES= \
     4.6  	Dart::Parser \
     4.7 +	Dart::ParserContext \
     4.8  	Dart::ParserError \
     4.9  	Dart::ScannerBase \
    4.10  	ctu_dart_compiler \
    4.11 @@ -63,6 +64,7 @@
    4.12  
    4.13  COMMON_OBJS= \
    4.14      $(OUTDIR_SLASH)Dart__Parser.$(O) \
    4.15 +    $(OUTDIR_SLASH)Dart__ParserContext.$(O) \
    4.16      $(OUTDIR_SLASH)Dart__ParserError.$(O) \
    4.17      $(OUTDIR_SLASH)Dart__ScannerBase.$(O) \
    4.18      $(OUTDIR_SLASH)ctu_dart_compiler.$(O) \
     5.1 --- a/compiler/abbrev.stc	Tue Nov 04 00:18:07 2014 +0000
     5.2 +++ b/compiler/abbrev.stc	Tue Nov 04 00:31:38 2014 +0000
     5.3 @@ -2,6 +2,7 @@
     5.4  # this file is needed for stc to be able to compile modules independently.
     5.5  # it provides information about a classes filename, category and especially namespace.
     5.6  Dart::Parser Dart__Parser ctu:dart/compiler 'Languages-Dart-Parser' 0
     5.7 +Dart::ParserContext Dart__ParserContext ctu:dart/compiler 'Languages-Dart-Parser' 0
     5.8  Dart::ParserError Dart__ParserError ctu:dart/compiler 'Languages-Dart-Parser' 1
     5.9  Dart::ScannerBase Dart__ScannerBase ctu:dart/compiler 'Languages-Dart-Parser' 3
    5.10  ctu_dart_compiler ctu_dart_compiler ctu:dart/compiler '* Projects & Packages *' 3
     6.1 --- a/compiler/bc.mak	Tue Nov 04 00:18:07 2014 +0000
     6.2 +++ b/compiler/bc.mak	Tue Nov 04 00:31:38 2014 +0000
     6.3 @@ -70,6 +70,7 @@
     6.4  
     6.5  # BEGINMAKEDEPEND --- do not remove this line; make depend needs it
     6.6  $(OUTDIR)Dart__Parser.$(O) Dart__Parser.$(H): Dart__Parser.st $(INCLUDE_TOP)\stx\goodies\petitparser\PPCompositeParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPDelegateParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPParser.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
     6.7 +$(OUTDIR)Dart__ParserContext.$(O) Dart__ParserContext.$(H): Dart__ParserContext.st $(INCLUDE_TOP)\stx\goodies\petitparser\PPContext.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
     6.8  $(OUTDIR)Dart__ParserError.$(O) Dart__ParserError.$(H): Dart__ParserError.st $(INCLUDE_TOP)\stx\libbasic\Error.$(H) $(INCLUDE_TOP)\stx\libbasic\Exception.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
     6.9  $(OUTDIR)Dart__ScannerBase.$(O) Dart__ScannerBase.$(H): Dart__ScannerBase.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
    6.10  $(OUTDIR)ctu_dart_compiler.$(O) ctu_dart_compiler.$(H): ctu_dart_compiler.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(STCHDR)
     7.1 --- a/compiler/compiler.rc	Tue Nov 04 00:18:07 2014 +0000
     7.2 +++ b/compiler/compiler.rc	Tue Nov 04 00:31:38 2014 +0000
     7.3 @@ -25,7 +25,7 @@
     7.4        VALUE "LegalCopyright", "My CopyRight or CopyLeft\0"
     7.5        VALUE "ProductName", "ProductName\0"
     7.6        VALUE "ProductVersion", "6.2.4.0\0"
     7.7 -      VALUE "ProductDate", "Tue, 04 Nov 2014 00:16:20 GMT\0"
     7.8 +      VALUE "ProductDate", "Tue, 04 Nov 2014 00:31:05 GMT\0"
     7.9      END
    7.10  
    7.11    END
     8.1 --- a/compiler/ctu_dart_compiler.st	Tue Nov 04 00:18:07 2014 +0000
     8.2 +++ b/compiler/ctu_dart_compiler.st	Tue Nov 04 00:31:38 2014 +0000
     8.3 @@ -79,6 +79,7 @@
     8.4      ^ #(
     8.5          "<className> or (<className> attributes...) in load order"
     8.6          #'Dart::Parser'
     8.7 +        #'Dart::ParserContext'
     8.8          #'Dart::ParserError'
     8.9          #'Dart::ScannerBase'
    8.10          #'ctu_dart_compiler'
     9.1 --- a/compiler/libInit.cc	Tue Nov 04 00:18:07 2014 +0000
     9.2 +++ b/compiler/libInit.cc	Tue Nov 04 00:31:38 2014 +0000
     9.3 @@ -28,6 +28,7 @@
     9.4  OBJ snd; struct __vmData__ *__pRT__; {
     9.5  __BEGIN_PACKAGE2__("libctu_dart_compiler", _libctu_dart_compiler_Init, "ctu:dart/compiler");
     9.6  _Dart__Parser_Init(pass,__pRT__,snd);
     9.7 +_Dart__ParserContext_Init(pass,__pRT__,snd);
     9.8  _Dart__ParserError_Init(pass,__pRT__,snd);
     9.9  _Dart__ScannerBase_Init(pass,__pRT__,snd);
    9.10  _ctu_137dart_137compiler_Init(pass,__pRT__,snd);