CSC 1800 Organization of Programming Languages Date Syntax 1 - - PDF document

csc 1800 organization of programming languages
SMART_READER_LITE
LIVE PREVIEW

CSC 1800 Organization of Programming Languages Date Syntax 1 - - PDF document

CSC 1800 Organization of Programming Languages Date Syntax 1 Assignment 2 BNF/EBNF for date syntax Five programs that check prime numbers (use a similar approach to Assignment 1) 2 2 1 Where is Date Syntax Used? Applications


slide-1
SLIDE 1

1

CSC 1800 Organization of Programming Languages

Date Syntax

2

Assignment 2

⚫ BNF/EBNF for date syntax ⚫ Five programs that check prime numbers (use a similar

approach to Assignment 1)

1 2

slide-2
SLIDE 2

2

3

Where is Date Syntax Used?

⚫ Applications that incorporate a date (birth date,

anniversary, due date, appointment date, deadline, calendar event, etc.)

⚫ Programs that analyze textual input and find all dates ⚫ Program that perform computation with dates: days

between, day of the week, date of special days, how many days you've been alive, etc.

4

Finding Date Syntax Samples

Gather as many examples of date syntax as you can

⚫ Search your computer and external systems for various

representations of a date and develop a description of each representation in BNF or EBNF.

⚫ Note: there are at least 12 commonly used

representations, and perhaps more.

3 4

slide-3
SLIDE 3

3

5

Assumptions

⚫ A date must contain day, month, and year.

It is not valid if any of the three parts is missing.

⚫ A date may not contain any other

components than day, month, and year, with the exception of field separators.

6

A Few Samples

⚫ 1/1/20 ⚫ January 1, 2020 ⚫ 1 Jan 2020

5 6