• Welcome to TUKE FĂ“RUM - FĂłrum pre študentov Technickej Univerzity v Košiciach.
 
Menu

Zobrazi» príspevky

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Zobrazi» príspevky Menu

Messages - Raleon

#76
Quote from: hlsman on  10.05.2009, 22:47:51
Raleon podla mna si importol zly Token preto ti to nesedi..
import tuke.pargen.annotation.Token;
Sakra. Ano.  :embarassed:
Uz ten token berie...
Ale i tak hodi build tie iste chyby, a stale pise COLON namiesto :    (atd)

(aha, moze byt ze preto , lebo este constraints som nepoannotoval ?)
#77
Quote from: paly-sk on  10.05.2009, 22:31:39
Quote from: Raleon on  10.05.2009, 22:22:17
Na token name pri property mi hodi netbeans chybu:
Incompatible types
found: org.javacc.parser.Token
required: java.lang.annotation.Annotation
a tak isto pri enumeracii :(
oznacil si druhy konstruktor anotaciou @Exclude?

ano. Inak i to da do ebnf s |...

zaujimave, ze co vypluje ten onen, tak to vyzera takto ::
Entity ::= (<ENTITY> <NAME> (<LBR> (Property (Property)*) <RBR>))
Length ::= (<MIN_LENGTH> <MAX_LENGTH>)
Model ::= (Entity (Entity)*)
Property ::= (<NAME> (<COLON> Type) ((Constraint ((<COMMA> Constraint))*))?)

(to je len cast z toho / nemm tam normalne dvojbodku, ale tak blbo ze colon, atd)


Tu je kod property:
public class Property {

    private final String name;
    private Constraint[] constraints;

    public Property(@Token("NAME") String name ,@Before("COLON") Type type,  @Separator("COMMA") Constraint[] constraints)
    {
      this.name=name;
      this.type=type;
      this.constraints=constraints;
    }

    @Exclude
    public Property(String name, Type type) {
        this.name = name;
        this.type = type;
    }

    public Constraint[] getConstraints() {
        return constraints;
    }

    public void setConstraints(Constraint[] constraints) {
        this.constraints = constraints;
    }

    public enum Type {
        @Token("INTEGER") INTEGER, @Token("REAL") REAL, @Token("STRING") STRING;
    }
    private final Type type;



    public String getName() {
        return name;
    }

    public Type getType() {
        return type;
    }

    public <T extends Constraint> T getConstraint(Class<T> clazz) {
        if (constraints==null) return null;
        for (Constraint c : constraints) {
            if (c.getClass().getSimpleName().compareTo(clazz.getSimpleName()) == 0) {
                return (T) c;
            }
        }
        return null;
    }

    public boolean hasConstraint(Class<? extends Constraint> clazz) {
        if (constraints==null) return false;
        for (Constraint c : constraints) {
            if (c.getClass().getSimpleName().compareTo(clazz.getSimpleName()) == 0) {
                return true;
            }
        }
        return false;
    }

    @Override
    public String toString() {
        if (constraints != null) {
            return name + Arrays.asList(constraints);
        } else {
            return name;
        }
    }
}


Pri Clean and build  vypise toto:
init:
deps-clean:
Deleting directory E:\Thomass\Programming\Java\mags\build
clean:
init:
deps-jar:
Created dir: E:\Thomass\Programming\Java\mags\build\classes
Compiling 40 source files to E:\Thomass\Programming\Java\mags\build\classes
E:\Thomass\Programming\Java\mags\src\sk\tuke\magsa\parserext\Parser.java:4: package sk.tuke.magsa.parserext.javacc does not exist
  private static sk.tuke.magsa.parserext.javacc.Parser parser;
YAJCo parser generator 0.1
YAJCo: Generating output to 'file:/E:/Thomass/Programming/Java/mags/src/sk/tuke/magsa/parserext/javacc/grammar.jj'
Java Compiler Compiler Version 4.0 (Parser Generator)
(type "javacc" with no arguments for help)
Reading from file E:\Thomass\Programming\Java\mags\src\sk\tuke\magsa\parserext\javacc\grammar.jj . . .
org.javacc.parser.ParseException: Encountered ")" at line 70, column 3.
Was expecting one of:
    "LOOKAHEAD" ...
    "try" ...
    "(" ...
    "{" ...
    "[" ...
    "boolean" ...
    "char" ...
    "byte" ...
    "short" ...
    "int" ...
    "long" ...
    "float" ...
    "double" ...
    <IDENTIFIER> ...
    "+" ...
    "-" ...
    "++" ...
    "--" ...
    "~" ...
    "!" ...
    <INTEGER_LITERAL> ...
    <FLOATING_POINT_LITERAL> ...
    <CHARACTER_LITERAL> ...
    <STRING_LITERAL> ...
    "true" ...
    "false" ...
    "null" ...
    "this" ...
    "super" ...
    "new" ...
    "void" ...
    "options" ...
    "IGNORE_CASE" ...
    "PARSER_BEGIN" ...
    "PARSER_END" ...
    "JAVACODE" ...
    "TOKEN" ...
    "SPECIAL_TOKEN" ...
    "MORE" ...
    "SKIP" ...
    "TOKEN_MGR_DECLS" ...
    "EOF" ...
    "<" ...
   
Detected 1 errors and 0 warnings.
E:\Thomass\Programming\Java\mags\src\sk\tuke\magsa\parserext\Parser.java:4: package sk.tuke.magsa.parserext.javacc does not exist
  private static sk.tuke.magsa.parserext.javacc.Parser parser;
E:\Thomass\Programming\Java\mags\src\sk\tuke\magsa\parserext\Parser.java:12: package sk.tuke.magsa.parserext.javacc does not exist
      parser = new sk.tuke.magsa.parserext.javacc.Parser(reader);
E:\Thomass\Programming\Java\mags\src\sk\tuke\magsa\parserext\Parser.java:14: package sk.tuke.magsa.parserext.javacc does not exist
      sk.tuke.magsa.parserext.javacc.Parser.ReInit(reader);
E:\Thomass\Programming\Java\mags\src\sk\tuke\magsa\parserext\Parser.java:18: package sk.tuke.magsa.parserext.javacc does not exist
      sk.tuke.magsa.metamodel.Model root = sk.tuke.magsa.parserext.javacc.Parser.parse();
E:\Thomass\Programming\Java\mags\src\sk\tuke\magsa\parserext\Parser.java:21: package sk.tuke.magsa.parserext.javacc does not exist
    } catch (sk.tuke.magsa.parserext.javacc.ParseException e) {
Note: E:\Thomass\Programming\Java\mags\src\sk\tuke\magsa\metamodel\Property.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors
BUILD FAILED (total time: 0 seconds)
#78
Quote from: paly-sk on  10.05.2009, 22:02:13
    public Property(
            @Token("NAME") String name,
            @Before("COLON") Type type,
            @Separator("COMMA") Constraint[] constraints) {
        ...
    }

a zaroven treba anotavat aj enumeracny typ:

    public enum Type {
        @Token("INTEGER") INTEGER,
        @Token("REAL") REAL,
        @Token("STRING") STRING;
    }

Na token name pri property mi hodi netbeans chybu:
Incompatible types
found: org.javacc.parser.Token
required: java.lang.annotation.Annotation
a tak isto pri enumeracii :(
#79
Quote from: paly-sk on  10.05.2009, 18:09:32
startovaci symbol je Model
cize pojdes to triedy model a do konstruktora das @Range(minOccurs =1), kedze v ebnf je zapisane entity+ a to vyjadruje, ze model musi obsahovat aspon jednu entitu
tzn. ze konstruktor Model musi mat pred Entity[] entities anotaciu @Range(minOccurs = 1)
model by bol vyrieseny a ides hlbsie, kedze parametrom modelu je objekt typu Entity, tak ides do tej triedy
a teraz vidis, ze v ebnf je Entity rozpisana ako ako 'entity' <NAME> ...
to znamena ze pred konstruktor das anotaciu before a ako parameter je das ENTITY (ked si blizsie pozries ten subor package-info.java, tak tam su definovane lexikalne jednotky a pod tokenom ENTITY sa skryva entity)
a teraz v konstruktori prvy parameter je name, cize to uz bude @Token("NAME")
a potom ide 1 a viac properties
cize ked pozries ebnf, tak tam najprv vidis {
cize pred Property[] properties das @Before("LBR") a zaroven aj @After("RBR"), lebo zatvrokami koncia aj definovanie entity v ebnf
a este tam das @Range(minOccurs = 1), lebo entita musi mat aspon jednu property podla ebnf

Snad by ti to uz malo byt jasne. Teraz uvidis vyhodu vyuzitia tohto generatora oproti vlastnemu krkolomnemu parseru, ktory sme robili na zaciatku ;-)

Ked to budes mat cele, tak pozri subor grammar.ebnf a mal byt taky isty ako je v tom 10. cviku (niektore zatvorky si mozes odmysliet v tej vygenerovanej gramatike) a este to co je na stranke ako Entity+ budes mat vo svojej gramatike ako (Entity (Entity)*). Potom uz len staci 2-krat skompilovat a nasledne spustit a nezabudni pridat do konstruktora vytvorenie toho parsera ako je v 5. tej ulohe.

Hmm. diky, Tebou popisana cast aj ide.
Ale ako dalej annotovat property, atd.? bo uz tam mi netbeans neakceptuje tie tokeny, before alebo after, ...
#80
php, html, css, javascript, c, c++, c#, java, delphi, assembler
cinema4d, gimp,
flstudio


Ak je moznost ziskania penazi bez prace, je vytana.
#82
Quote from: BCAA on  19.04.2009, 23:07:08
ta skus checknut aku verziu jdk mas a take srandy (vies jak to ze to ide u inych moze znamenat ze maju inu konfiguraciu systemu  ine jdk a pod) 

napr v jave EE 5 ma @XmlTransient    @Target(value={FIELD,METHOD})
no v java SE 6 ma @XmlTransient   @Target(value={FIELD,METHOD,TYPE})

by som odporucil si pozriet presne deklaraciu tej anotacie @XmlTransient  (v NB ctrl+click nad @XmlTransient elemente v kode )

a ked ani to nepomoze  ta moze to byt chyba v NB samotnom (potom uz len indicky sposob  turn on/off) :)



dpc fakt :(
diky
#83
cudne...

u mna hlasi chybu aj v kode inych...
u inych moj kod je ok.

Milujem netbeans :hammer:
#84
Mal niekto troblemy s tymi anotaciami ?
mne furt podciarkne
@XmlTransient
ze nemoze byt aplikovany na taky typ deklaracie.
hoci to dam tam kde podla ulohy treba .
#85
1. ro?nĂ­k / Re: Asembler
30.03.2009, 04:45:22
>>helpdesk<< :)
#86
1. ro?nĂ­k / Re: Asembler
27.03.2009, 20:58:24
Este stale mate zadanie niekto neodovzdane?
#87
Inac, Pondelok rano Poruban asi nedojde, taze zbytocne tam ist , keby ste aj chceli...
#89
Quote from: Bc. nemtom on  04.03.2009, 22:20:21
zoznam objektov je trieda model

Myslel som uz v generovanom kode
#90
Quote from: jaros51 on  04.03.2009, 19:28:59
spat k cvikam, ako implementujete to rozhranie a potom cely ten crud system, ma to byt v povodnom adresari? alebo to ma ficat inde ? Piste svoje postrehy pls.

dobra otazka. Ale co ma byt vlastne v tom CRUD?? (create update delete, a este nieco?  a kde su vlastne zoznami objektov? ci nejaky entity manager tam dat ci what?)
#91
4. ro?nĂ­k / Re: teoreticka informatika
17.02.2009, 07:12:10
Quotegl Cheesy kedy mate skusku? Cheesy

termin je vypisany na 26.2
#92
4. ro?nĂ­k / Re: teoreticka informatika
12.02.2009, 01:45:44
Quote from: ondY.ke on  12.02.2009, 01:19:54
btw veduci ked by si neprisiel a si tam nepocita sa ti to za termin ze si tam bol?

ak dobre viem, ked si prihlaseny, ak neprides , tak mas FX, a -1 termin.
Jedine keby si mal nejake ospravedlnenie.
#93
4. ro?nĂ­k / Re: teoreticka informatika
10.02.2009, 10:54:06
To ani ty nespis ?
#94
4. ro?nĂ­k / Re: teoreticka informatika
10.02.2009, 08:55:51
som mierne pokakany  :nervous:
#95
4. ro?nĂ­k / Re: teoreticka informatika
10.02.2009, 07:03:43
 bk
ta.. ale tu prvu stranu viem kvalitne  :D
#96
4. ro?nĂ­k / Re: teoreticka informatika
10.02.2009, 06:43:48
Quote from: ywetka on  10.02.2009, 06:41:30
Quote from: Raleon on  10.02.2009, 06:21:37
Ema, co mas to za  slovicko ,,piki'' na 2 strane, pri nerodovych ekvivalencii ?? 

no toto! vidno, ze si este stale poriadne nenauceny! to si dokonca aj ja pamatam ;)

PS: nie, nie je to mierna verzia nadavky :P

:D no ....

akoze som interpretoval tak, ze na konci 3. bodu  ten 2.bod.. ta co ja viem... Na toto mi nesu bunky nastavene :)


Edit: Prebieha reinterpretacia podla postu 140155 ...
Za odpoved dakujem. (ale ani tak neviem co tam hlada to p a k... dufam ze Hudak vie, a nespyta sa :) )
#97
4. ro?nĂ­k / Re: teoreticka informatika
10.02.2009, 06:21:37
Ema, co mas to za  slovicko ,,piki'' na 2 strane, pri nerodovych ekvivalencii ?? 
#98
4. ro?nĂ­k / Re: teoreticka informatika
09.02.2009, 22:53:12
Z kazdej temy moze davat otazky??
prebral on vse na prednaskach z tychto tem, co tam vypisal?
#99
4. ro?nĂ­k / Re: teoreticka informatika
09.02.2009, 16:37:09
Aaaale. Dufam mas pravdu. Totiz Vokokokos ma nejaky vokyn, ze skuska sa vykonat este v tom semestri kedy bol vyucovany dany predmet.
#100
O ničom / Re: kurz zru?nosti?
09.02.2009, 02:31:30
Quote from: Pusta on  05.02.2009, 06:53:34
ja som velmi sikovna a prakticka do zivota!!
ak zavolate ihned dostanete MNA za vybornu cenu len 99 eur + utierku prachu "magic duster" ZDARMA!
Das zlavu na ISIC? :)