[Wikitech-l] How to write a parser

2012-06-20 Thread Niklas Laxström
No, this is not about a wikitext parser. Rather something much simpler. Have a look at [1] and you will see rules like: n in 0..1 n is 2 n mod 10 in 3..4,9 and n mod 100 not in 10..19,70..79,90..99 Long ago when I wanted to compare the plural rules of MediaWiki and CLDR I wrote a parser for the

Re: [Wikitech-l] How to write a parser

2012-06-20 Thread Domas Mituzas
Well, the syntax is: condition = and_condition ('or' and_condition)* and_condition = relation ('and' relation)* relation = is_relation | in_relation | within_relation | 'n' EOL is_relation = expr 'is' ('not')? value in_relation = expr ('not')? 'in' range_list within_relation = expr

Re: [Wikitech-l] How to write a parser

2012-06-20 Thread Antoine Musso
Le 20/06/12 13:02, Niklas Laxström a écrit : No, this is not about a wikitext parser. Rather something much simpler. Have a look at [1] and you will see rules like: n in 0..1 n is 2 n mod 10 in 3..4,9 and n mod 100 not in 10..19,70..79,90..99 Long ago when I wanted to compare the plural

Re: [Wikitech-l] How to write a parser

2012-06-20 Thread Tim Starling
On 20/06/12 21:02, Niklas Laxström wrote: No, this is not about a wikitext parser. Rather something much simpler. Have a look at [1] and you will see rules like: n in 0..1 n is 2 n mod 10 in 3..4,9 and n mod 100 not in 10..19,70..79,90..99 Long ago when I wanted to compare the plural

Re: [Wikitech-l] How to write a parser

2012-06-20 Thread Gabriel Wicke
On 06/20/2012 01:02 PM, Niklas Laxström wrote: No, this is not about a wikitext parser. Rather something much simpler. Have a look at [1] and you will see rules like: n in 0..1 n is 2 n mod 10 in 3..4,9 and n mod 100 not in 10..19,70..79,90..99 Long ago when I wanted to compare the

Re: [Wikitech-l] How to write a parser

2012-06-20 Thread Siebrand Mazeland
On Wed, June 20, 2012 20:20, Gabriel Wicke wrote: On 06/20/2012 01:02 PM, Niklas Laxström wrote: No, this is not about a wikitext parser. Rather something much simpler. Have a look at [1] and you will see rules like: n in 0..1 n is 2 n mod 10 in 3..4,9 and n mod 100 not in

Re: [Wikitech-l] How to write a parser

2012-06-20 Thread Krinkle
On Jun 20, 2012, at 1:02 PM, Niklas Laxström wrote: No, this is not about a wikitext parser. Rather something much simpler. Have a look at [1] and you will see rules like: n in 0..1 n is 2 n mod 10 in 3..4,9 and n mod 100 not in 10..19,70..79,90..99 Long ago when I wanted to compare the

Re: [Wikitech-l] How to write a parser

2012-06-20 Thread Krinkle
On Jun 21, 2012, at 7:13 AM, Krinkle wrote: On Jun 20, 2012, at 1:02 PM, Niklas Laxström wrote: No, this is not about a wikitext parser. Rather something much simpler. Have a look at [1] and you will see rules like: n in 0..1 n is 2 n mod 10 in 3..4,9 and n mod 100 not in