Hi, Yes, I know this is not a RPSL forum, but i think someone of you could help me ;-) I found a problem for RPSL parsers conform with RFC2622. In the RFC2622 (section 6.6) is an example of an import attribute:
import: from AS1 action pref = 1; accept as-foo; except { from AS2 action pref = 2; accept AS226; except { from AS3 action pref = 3; accept {128.9.0.0/16}; } }
Appendix B "Grammar Rules" describes the syntax like below:
... import_attribute: ATTR_IMPORT | ATTR_IMPORT opt_protocol_from opt_protocol_into import_factor
import_expression: import_term | import_term KEYW_REFINE import_expression | import_term KEYW_EXCEPT import_expression
import_term: import_factor ';' | '{' import_factor_list '}'
import_factor_list: import_factor ';' | import_factor_list import_factor ';'
import_factor: import_peering_action_list KEYW_ACCEPT filter
import_peering_action_list: KEYW_FROM peering opt_action | import_peering_action_list KEYW_FROM peering opt_action
...
I feel in import_attribute lakes a line like: | ATTR_IMPORT opt_protocol_from opt_protocol_into import_expression and a look into ftp://ftp.isi.edu/ra/RAToolSet/RAToolSet-4.6.3.tar.gz file src/rpsl/rpsl/rpsl.y agree with me:
... import_attribute: ATTR_IMPORT opt_protocol_from opt_protocol_into import_expr TKN_EOA { $$ = changeCurrentAttr(new AttrImport($2, $3, $4)); } | ATTR_IMPORT opt_protocol_from opt_protocol_into import_factor TKN_EOA { PolicyTerm *term = new PolicyTerm; term->append($4);
$$ = changeCurrentAttr(new AttrImport($2, $3, term)); } | ATTR_IMPORT error TKN_EOA { $$ = $1; handle_error("Error: from <peering> expected.\n"); yyerrok; } ; ..
OK as so far, but rpslcheck as well as my perl parser module breaks while parsing the example above ;-(
fb@sun5 1315> rpslcheck < example ... import: from AS1 action pref = 1; accept as-foo; except { from AS2 action pref = 2; accept AS226; except { ^^^^^^ ***Error: from <peering> expected. from AS3 action pref = 3; accept {128.9.0.0/16}; } } ...
For me looks the grammar correct, but my knowledge about automata theory, languages and computation is worser than my english ;-) Has anybody a solution for this problem ? cheers frank