[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Solving >> issue in templates
From: |
Adam Smalin |
Subject: |
Solving >> issue in templates |
Date: |
Mon, 14 Jan 2013 21:48:48 -0500 |
As we know in C++ there is a issue when doing something like this
List<List<int>> listOfInts
The problem is >> is seen as a shift token rather then a > token. How would
I solve this? My first thought was what if I check for two > for a shift?
Well... It looks fine, no conflicts but now I need to deal with presence
but luckily its very close
a << b < c << d < e << f
When it should be
(a << b) < (c << d) < (e << f)
What I suspect it is
(((((a << b) < c) << d) < e) << f)
This will feel weird to many. What kind of DSL does comparing before
arithmetics!?!
How do I restore order so << happens before <? I could put some logic in my
AST and fix it up before parsing but... that seems like the solution I
should do if no other choices exist. What can I do? I am unsure how I could
write this. All my tokens uses %left %right like the docs suggest and my
very many rule bison file has worked well.
- Solving >> issue in templates,
Adam Smalin <=