Hi Nate,

Sorry for the slow reply...thanks for your patience.

Your diff looks fine to me.  Initially I was confused why you needed to add the 
double colon as part of a type, but I now realize this doesn't change the 
protocol specifications files at all.  It simply allows the LiteralExprAST to 
generate the string type identifier as 'std::string' instead of 'string'.  As 
long as it doesn't impact the specification files, it is fine by me.

Brad


> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On
> Behalf Of nathan binkert
> Sent: Thursday, April 01, 2010 11:38 AM
> To: M5 Developer List
> Subject: Re: [m5-dev] std::string in slicc
> 
> Does anyone care enough to look at this?  I'm not opposed to a code
> review, but I don't want to sit around waiting.  Everything compiles
> and all regressions pass.  The main issue is that I've changed the
> slicc grammar slightly to accept :: in types.  Seems like a good thing
> to me, but I just wanted to know if anyone saw a problem with this.
> 
> If you need time, that's fine, at least let me know.
> 
>   Nate
> 
> On Wed, Mar 31, 2010 at 5:11 PM, nathan binkert <[email protected]>
> wrote:
> > I got rid of "using namespace std;" in ruby headers, but to do so, I
> > need to change string to std::string in slicc.  This requires that I
> > change the slicc parser to accept :: as part of a type.  The diff to
> > slicc is below.  (The whole diff is like 3000 lines, and is attached
> >
> > Anyone have a problem with this?
> >
> >  Nate
> >
> > diff --git a/src/mem/slicc/parser.py b/src/mem/slicc/parser.py
> > --- a/src/mem/slicc/parser.py
> > +++ b/src/mem/slicc/parser.py
> > @@ -394,8 +394,16 @@
> >         "types : empty"
> >         p[0] = []
> >
> > -    def p_type(self, p):
> > -        "type : ident"
> > +    def p_typestr__multi(self, p):
> > +        "typestr : typestr DOUBLE_COLON ident"
> > +        p[0] = '%s::%s' % (p[1], p[3])
> > +
> > +    def p_typestr__single(self, p):
> > +        "typestr : ident"
> > +        p[0] = p[1]
> > +
> > +    def p_type__one(self, p):
> > +        "type : typestr"
> >         p[0] = ast.TypeAST(self, p[1])
> >
> >     def p_void(self, p):
> > @@ -670,7 +678,7 @@
> >
> >     def p_literal__string(self, p):
> >         "literal : STRING"
> > -        p[0] = ast.LiteralExprAST(self, p[1], "string")
> > +        p[0] = ast.LiteralExprAST(self, p[1], "std::string")
> >
> >     def p_literal__number(self, p):
> >         "literal : NUMBER"
> >
> _______________________________________________
> m5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/m5-dev


_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to