PPSmaltalkGrammar>>number

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PPSmaltalkGrammar>>number

Nicolas Anquetil
I am studying the PP smaltalk parser and while trying to parse a literal
array, I stumbled on a problem:

initially I could not parse simple expressions like 'a := 100'
looking into it, I found that PPSmaltalkGrammar>>number cannot parse '100'

since the definition is a bit complex
---
number
     ^ ($- asParser optional , #digit asParser) and , [ :context |
         [ (NumberParser on: context stream) nextNumber ]
             on: Error
             do: [ :err | PPFailure message: err messageText at: context
position ] ]
                 asParser
---

I was wondering if anyone could shed some light on this


nicolas
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: PPSmaltalkGrammar>>number

Nicolas Anquetil
OK

it was easier than expected

I was using the wrong image  :-)

sorry about the noise

nicolas

On 20/10/2015 19:38, Nicolas Anquetil wrote:

> I am studying the PP smaltalk parser and while trying to parse a
> literal array, I stumbled on a problem:
>
> initially I could not parse simple expressions like 'a := 100'
> looking into it, I found that PPSmaltalkGrammar>>number cannot parse
> '100'
>
> since the definition is a bit complex
> ---
> number
>     ^ ($- asParser optional , #digit asParser) and , [ :context |
>         [ (NumberParser on: context stream) nextNumber ]
>             on: Error
>             do: [ :err | PPFailure message: err messageText at:
> context position ] ]
>                 asParser
> ---
>
> I was wondering if anyone could shed some light on this
>
>
> nicolas
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev