FAQ Database Discussion Community


How to listen for “any speech” in VoCon Hybrid and capture what was said

voice-recognition,bnf
Part of my task is to make a system that simulates dictating and sending a text message using Vocon. I tried using the <...> aka "garbage" rule like this: #BNF+EMV2.1; !grammar messageInput; !start <messageInput>; <messageInput> : cancel | <...>; Unfortunately that means I don't get what was said, but rather...

BNF grammar for a palindrome

bnf,ebnf
I need help with a non-extended BNF grammar: Σ = {a,b} L = {ω ɛ Σ^* | such that w is equal to the reverse of ω} For example, the strings aba, bab, and ababa are in the language, but string ababab is not. I am not sure if this...

Why parsing this program with BNFC fails?

parsing,bnf,bnfc
Given following grammar: comment "/*" "*/" ; TInt. Type1 ::= "int" ; TBool. Type1 ::= "bool" ; coercions Type 1 ; BTrue. BExp ::= "true" ; BFalse. BExp ::= "false" ; EOr. Exp ::= Exp "||" Exp1 ; EAnd. Exp1 ::= Exp1 "&&" Exp2 ; EEq. Exp2 ::= Exp2 "=="...

Python Language Reference And Function Definitions

python,documentation,bnf,ebnf
As I understand it, the python language reference is written in extended BNF format. While looking at the documentation for function definitions I noticed that the spec doesn't seem to support the usage of trailing *args or **kwargs parameters. parameter_list ::= (defparameter ",")* | "*" [parameter] ("," defparameter)* ["," "...

How to express BNF using Lisp?

lisp,racket,grammar,bnf
I want to express a grammar rule that is written in BNF using Lisp. here is the rule. It is important to note that non-terminals are represented in capital letters and the terminals are represented in small letters: A -> a A b I tried to use the define function...

Backus Naur Form Assoicativity

bnf,associativity
Is this the correct way to implement right associativity for Exponentiation PowExp? So that 2^3^4 is actually (2^(3^4)) <Exp> ::= <Exp> + <MulExp> | <Exp> - <MulExp> | <MulExp> <MulExp> ::= <MulExp> * <PowExp> | <MulExp> / <PowExp> | <PowExp> <PowExp> ::= <NegExp> ^ <PowExp> |<NegExp> <NegExp> ::= - <RootExp>...

Context Free Grammar BNF

grammar,context-free-grammar,bnf,ebnf,ambiguous-grammar
need help with a non-extended BNF grammar: Σ = {a,b,c} L = {ω ɛ Σ^* | such that all a's (if any) comes before all c's(if any)} For example, the strings aba, cbc, and abacbc are in the language, but string abcabc is not. This is what i have so...

How to use symbols and lists in scheme to process data?

scheme,racket,grammar,bnf
I am a newbie in scheme, and I am in the process of writing a function that checks pairwise disjointess of rules (for the time being is incomplete), I used symbols and lists in order to represent the rues of the grammar. Uppercase symbol is a non-terminal in the grammar,...

Bracket and brace usage in BNF?

syntax,language-agnostic,grammar,bnf,ebnf
Consider the following: A function parameter list is a sequence of zero or more parameters separated by commas and bracketed by parentheses, "(" and ")" . If I want to give the syntax of "function parameter list" assuming that the syntactic category of "parameter" has been defined, can I write:...

BNF grammar for a simple c++ program example

c++,parsing,bnf,bnfc
So i am trying to write grammar for a simple c++ program. this is how the grammar looks like right now: PDefs. Program ::= [Def] ; terminator Def "" ; comment "//" ; comment "/*" "*/" ; comment "#" ; DFun. Def ::= Type Id "(" [Arg] ")" "{" [Stm]...

How to exclude character " in a token JavaCC

bnf,javacc
Hello i´m working with JavaCC and I am writing a token that put one String between " ". Context: void literalString(): {} { """ (characteresString())? """ } void characteresString(): {} { <characterString> | characteresString() <characterString> } So i made this token to put one String: TOKEN : {<characterString : ~["\",...

Treetop grammar line continuation

ruby,parsing,bnf,treetop
I'm trying to create a grammar for a language like the following someVariable = This is a string, I know it doesn't have double quotes anotherString = This string has a continuation _ this means I can write it on multiple line _ like this anotherVariable = "This string is...

BNF for a hexadecimal number

grammar,context-free-grammar,bnf
As a homework assignment I have to write a BNF definition for a hexadecimal number <hex>. This is to be done using <digit> and <letter>, both of which are defined as follows: <digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |...