Regular and Context-Free Languages (AQA A-Level Computer Science): Flashcards

📚Flashcards
Regular and Context-Free Languages
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

10 cards from this deck

Show

Regular language

Language fully described using regular expressions

Context-free language

Language using BNF/syntax diagrams for complex nested structures

Regular vs context-free - key difference

Regular: simple linear; Context-free: complex hierarchical

* operator in regex

Zero or more of preceding element

++ operator in regex

One or more of preceding element

?? operator in regex

Zero or one of preceding element (optional)

Relationship between regex and FSM

Every regex can be represented as FSM and vice versa

Accepting state in FSM

State indicating valid string match (shown with double circle)

::=::= symbol in BNF

Means 'is defined as' or 'can be replaced with'

Ovals vs rectangles in syntax diagrams

Ovals: terminals; Rectangles: non-terminals

Join 100,000+ A-Level students studying Flashcards with us.

Select your subjects, and get access to A+ resources today.