Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
EBNF Languages defenitions for Parsing Engine

Hello everyone!

I using in my product control with syntax hightlighting. And i need add custom languages support in my project.

I found this page and understand that i need to use EBNF. I Found EBFN language defenition for PHP

There are first lines of this document:

PHP_SOURCE_TEXT = { inner_statement | halt_compiler_statement };

halt_compiler_statement = "__halt_compiler" "(" ")" ";" ;

inner_statement = statement
	| function_declaration_statement
	| class_declaration_statement ;

inner_statement_list = { inner_statement } ;

But with this syntax i have many errors. First on line #3 and then some about ten various errors.

Then i found this page

All what i understand that i need to use another language defenition, but unfotunatly i don't understand, how i have to write correct EBNF language defenition.

Please let me know, where i cen see some example or documentation about it? 

I need create defenitions for many langugages and now this is big problem for me

Thank you!