1 / 11

Method of Language Definition

Method of Language Definition. A Language is defined by: A: Lexical = Valid Tokens & Words B: Syntax = The GRAMMER of the Language C : Semantics = The MEANING of valid syntactical statement. Language. A: Lexical B: Syntax. Written English

iolana
Download Presentation

Method of Language Definition

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Method of Language Definition • A Language is defined by: • A: Lexical = Valid Tokens & Words • B: Syntax = The GRAMMER of the Language • C: Semantics = The MEANING of valid syntactical statement Language

  2. A: Lexical B: Syntax Written English 26 letter and . ? ! Special Characters Words Obj of Preposition Verb Clause Sentences The Valid Tokens create “Words” - Expression then become Statement – Complete Statement Rules – Spelling of Words – Completing a sentence

  3. C. Semantics • Semantics • Meaning of a valid syntactical statement • Context free • Context sensitive

  4. Let’s Study language • First, let’s look at a programming language • Java • A: Syntax • Valid Token Alphabet & Spec. Char Words Class, Private, Public Statement – if (A < B) {B = A;}

  5. Syntax Graph

  6. Let’s look at another programming language • A Language is defined <N, T, S, P> where • T is a finite set of terminal symbols, • N is a finite set of non-terminal symbols, • S is the start symbol, S, • P is a finite set of production rules of the form, • Let’s see the grammar of Arithmetic expressions in the next slide. 

  7. Language is defined <N, T, S, P> where • N= Non-terminal symbols: • <Exp>, <Term>, <Factor> • T= Terminal symbols: • +, -, *, /, (, ), x, y, z, ... • S= Start symbol: • <Exp> • P= Production rules: • <Exp> ::= <Exp> + <Term> | • <Exp> - <Term> | • <Term> • <Term> ::= <Term> * <Factor> | • <Term> / <Factor> | • <Factor> • <Factor> ::= x | y | ... | • ( <Exp> ) | • - <Factor> • A grammar for the concrete syntax of simple arithmetic expressions

  8. Semantics “The MEANING of a correct … • If A + 2 > B then A = 10; • Logic that decomposes to “machine activity” • Register • ACU

  9. Think! Your Project • Possible expressions: • Registering • Log in • Search • Find home • For Log in • Mouse Travel • define : 1) Tokens = Mouse Selection • Ind. on screen Obj. • Mult. On screen Obj. • valid expressions Words • Define criteria

  10. Possible tokens in your interaction Language • MT : Mouse Travel • MS: Mouse Selection • – indicate the on screen object • Mult: Multiple Selection • multiple screen objects selected Alph + Specific (except + ENTER TAB) • S: String

  11. Example • Goal - Login • A valid syntactical login: • MT => Click when on B1 • => S • => Tab • => SH • => Enter P1 B1 B2 B3

More Related