Strings and Concrete Syntax Flashcards

1
Q

What is an alphabet

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a string (and empty string)

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a language

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a substring

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does concatenation and k-fold concat work

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the length of a string

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a (concrete) syntax

A

A description of which strings constitute a valid sentence in the language, or more specifically for us, a valid program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a grammar

A

A formal (often context free) definition/way of describing the syntax of a language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How are grammars defined (using numbered rules)

A

Each line is called a production rule

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How are grammars defined (compactly organised via their rule)

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a non-terminal symbol of a grammar

A

Symbols which have a rule and can be recursively replaced.

In the above example {A, F, L} are non-terminal symbols

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are terminal symbols

A

Terminal symbols are final values for a derivation of a grammar and are part of its alphabet

In the above example {+,-,*,(,),n} (where is is any natural number) are terminal symbols

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the process of deriving an expression from a grammar look like

A

Start with the ‘start symbol’ and recusively replace the terms until all are terminal symbols

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

In the Arithmatic grammar, what does the non-terminal symbol ‘A’ represent?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In the Arithmatic grammar, what does the non-terminal symbol ‘L’ represent?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In the Arithmatic grammar, what does the non-terminal symbol ‘F’ represent?

A
17
Q

What is the concise definition of Turtle Graphics grammar

A