Introduction to Syntax report

July 14 2003, Sunday

We have three modules:
  • Code generation
  • Code parser
  • Semantic Network Genration
    Code Generator:
    Aim of this module is understanding natural language inputs and translating them to java code.

    Input Sentences:
    Original input sentences in Turkish:Translations:
    otomobil bir ta??tt?rAutomobile is a vehicle
    otomobil benzin ve ya? tüketirAutomobile consumes fuel and oil
    bütün otomobillerin rengi modeli ve markas? vard?r Automobile has color model and brand
    insan ekmek üretirhuman produces bread
    insan bal?k avlar human hunts for fish

    Code generated by above input sentences:
    class otomobil extends tasit{
    private Renk renk;
    private Model model;
    private Marka marka;
    public void setRenk(Renk renk){this.renk=renk;}
    public Renk getRenk(){return renk;}
    public void setModel(Model model){this.model=model;}
    public Model getModel(){return model;}
    public void setMarka(Marka marka){this.marka=marka;}
    public Marka getMarka(){return marka;}
     
    public tuket(Benzin benzin, Yag yag){}
    }
     
    class insan{
    public Ekmek uret(){}
    public Balik av(Balik balik){}
    }

    Accepted syntax for code generator

  • Class Definition Sentences
  • Attribute Definition Sentences
  • Method Definition Sentences
  • Relation Definition Sentences


  • Class Definition Sentences :
    Otomobil isimli | adl? bir kavram | nesne | s?n?f vard?r.
    Ad? | ismi otomobil olan bir kavram | nesne | s?n?f vard?r.
    Otomobil diye bir kavram | nesne | s?n?f vard?r.
    Otomobil diye bir?ey vard?r.
    Otomobil bir kavramd?r | nesnedir | s?n?ft?r.


  • Attribute Definition Sentences :
    Otomobilin rengi, markas?, modeli vard?r.

    Her otomobil renge, markaya, modele sahiptir.
    Bütün otomobiller | otomobil renge, markaya, modele sahiptir.

    Otomobil renkle, markayla, modelle tan?mlan?r.
    Otomobil rengiyle, markas?yla, modeliyle tan?mlan?r | tan?n?r.

    Otomobil kavram? renkten, markadan, modelden olu?turulur.
    Otomobil kavram? | otomobil renkten, markadan, modelden olu?ur.

    Renk, marka ve model otomobil kavram?n? olu?turur | yarat?r | tan?mlar.
    Renk, marka ve model otomobili olu?turur | yarat?r | tan?mlar.
    Otomobil kavram? renk, marka, model ile olu?ur | yarat?l?r.

    Problems:
    How can we determine the member access specifier of an attribute?.
    (public, private or protected).

  • Method Definition Sentences :
    Otomobil h?zlan?r.
    void h?zlanmak();

    Otomobil 10km h?zlan?r.
    void h?zlanmak(int);

    Otomobil h?zlan?nca h?z? 90km olur.
    int h?zlanmak();

    Otomobil h?zlan?nca h?z? 2 kat?na ç?kar.
    int h?zlanmak(int);

  • Relation Definition Sentences :

    public class Otomobil extends Tasit implements MouseListener{}

    i)Inheritance :
    Her otomobil bir ta??tt?r.
    Bütün otomobiller birer ta??tt?rlar.
    i)Packages :
    Sürücüler otomobillerle ili?kilidir | ba?lant?l?d?r.
    Sürücü kavram?, otomobil kavram?yla ili?kilidir | ba?lant?l?d?r.
    i)Implements :
    Otomobil fare kullan?r.—Ba?ka alternatif ne olabilir?
    Sürücü trafik kurallar?na uyar.