Questions tagged [ebnf]

EBNF stands for Extended Backus-Naur Form, or Extended Backus Normal Form. It is an extension to BNF and is used to describe the syntax of context-free grammars, such as programming languages, document formats, or communication protocols. It improves over BNF by providing operators to express optional, zero or more, and one or more occurrences of a term. This makes EBNF much more expressive and concise compared to BNF.

EBNF is standardized format for documenting syntax. It includes an extension mechanism for defining a two-level grammar that can produce an infinite number of production rules.

References

354 questions
-1
votes
2 answers

How to build complex vs code snippet variable transforms?

I'm trying to write a code snippet for vs code that takes a given file name, removes a piece of the name and capitalizes the first letter. For example Input: example.model.js Output: Example Output im…
B4dmonkey
  • 112
  • 1
  • 2
  • 12
-1
votes
1 answer

How to do { }?

I'm going to check whether the input is correct. This is syntax: ::= | LEFT-PAREN { } [ DOT ] RIGHT-PAREN | QUOTE ::= SYMBOL | INT | FLOAT | STRING …
Kias
  • 47
  • 5
-1
votes
1 answer

Can't parse EBNF formula in python

import argparse from parglare import Grammar from parglare import Parser formula = r""" Formula : Number | (Formula Sign Formula) Number : '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' Sign : '+' | '-' """ grammar =…
-1
votes
1 answer

How to implement this kind of EBNF grammar (lookahead)?

I am trying to parse the string "###" using an EBNF grammar in TatSu (grako) of this kind: grammar = """mask = | ['()'] ['$'] {'#'} '#' | ['()'] {'#'} '#%' | ['()'] ['$'] {'#'} {'0'} '0' '.#'…
MadInc
  • 1
  • 3
-1
votes
1 answer

What is the EBNF grouping in yacc

I am writing a program grammar with lex/yacc. I have an issue about ambiguity of grammar and i need to look EBNF grammar. When I searched semantic of yacc and its declarations, i see grouping({.....}) but i do not know how i can initialize it. For…
Burak
  • 13
  • 4
-1
votes
1 answer

Reading EBNF Grammar

I just needed help with reading this EBNF grammar, I'm new to it and don't particularly understand the first , I understand the second one but just don't understand how it ties in with the first one. Term ::= Primary { (T_STAR|T_SLASH) Term…
McDodger
  • 43
  • 1
  • 1
  • 7
-1
votes
1 answer

BNF to EBNF conversion

I've trying to convert a given BNF list to EBNF and im completely clueless how. Can anyone help? The BNF is: :== :== :==
:==…
-3
votes
2 answers

How can Pascal have conditions when it doesn't have boolean type?

Based on formal Pascal EBNF definition (pg69-75), I saw that Pascal only supports 3 primitive types: Integer, Real and String. In C, any values which are different from 0 can be interpreted as a true literal. Pascal doesn't work like C. How can…
MiP
  • 5,846
  • 3
  • 26
  • 41
-4
votes
1 answer

Need to find out production rules of a web site

Is there a tool to generate these rules in ebnf format? Then i will do lexical analysis and syntax. What can be used? And these rules will be just like HTML rules, won't be?
user3683963
  • 25
  • 2
  • 6
1 2 3
23
24