X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=grammer%2Fspec_compiler.jj;h=575dcf32b569fcf2aec4b24a1ebea85031760497;hb=a0721aba5feb313cce48120d4e98e0165bb476bc;hp=9950ad886f7926bd2712d192ad5fa2ccfa292db9;hpb=c8b24673cc3105a8d16e37a915d5b04074b3a3a1;p=cdsspec-compiler.git diff --git a/grammer/spec_compiler.jj b/grammer/spec_compiler.jj index 9950ad8..575dcf3 100644 --- a/grammer/spec_compiler.jj +++ b/grammer/spec_compiler.jj @@ -50,19 +50,53 @@ @Begin @Potential_commit_point_define: ... @Label: ... + @End + + OR + + @Begin + @Potential_additional_ordering_point_define: ... + @Label: ... @End d) Commit point define construct @Begin @Commit_point_define_check: ... @Label: ... + @End + + OR + + # Addition ordering point is used to order operations when there are "equal" + # commit point operations on the same location and that we cannot decide + # which operation goes first, we will use additional ordering point to order + # them (it's just similar to commit points). In implementation, we can just + # treat them as commit points with a special flag. + + @Begin + @Additional_ordering_point_define: ... + @Potential_additional_ordering_point_label: ... + @Label: ... @End OR + + @Begin + @Additional_ordering_point_define: ... + @Label: ... + @End + + OR @Begin - @Commit_point_define: ... - @Potential_commit_point_label: ... + @Additional_ordering_point_define_check: ... + @Label: ... + @End + + // Commit point clear (just as a normal commit point, but it is used to + // clear all commit points) + @Begin + @Commit_point_clear: ... @Label: ... @End @@ -122,6 +156,7 @@ import edu.uci.eecs.specCompiler.specExtraction.InterfaceConstruct; import edu.uci.eecs.specCompiler.specExtraction.PotentialCPDefineConstruct; import edu.uci.eecs.specCompiler.specExtraction.CPDefineConstruct; import edu.uci.eecs.specCompiler.specExtraction.CPDefineCheckConstruct; +import edu.uci.eecs.specCompiler.specExtraction.CPClearConstruct; import edu.uci.eecs.specCompiler.specExtraction.ConditionalInterface; import edu.uci.eecs.specCompiler.specExtraction.SequentialDefineSubConstruct; import edu.uci.eecs.specCompiler.specExtraction.InterfaceDefineConstruct; @@ -367,14 +402,24 @@ SKIP : { | +| + | | +| + | +| + +| + | +| + } @@ -610,24 +655,6 @@ String Type() : } } -void Test() : -{ - String str; - FunctionHeader func; -} -{ - /* - str = Type() - { - System.out.println(str); - } - */ - func = FuncDecl() - { - System.out.println(func); - } - -} String ParameterizedName() : { @@ -903,6 +930,10 @@ Construct ParseSpec() : LOOKAHEAD(2) res = Potential_commit_point_define() | LOOKAHEAD(2) res = Commit_point_define() | LOOKAHEAD(2) res = Commit_point_define_check() | + LOOKAHEAD(2) res = Potential_additional_ordering_point_define() | + LOOKAHEAD(2) res = Additional_ordering_point_define() | + LOOKAHEAD(2) res = Additional_ordering_point_define_check() | + LOOKAHEAD(2) res = Commit_point_clear() | LOOKAHEAD(2) res = Entry_point() | LOOKAHEAD(2) res = Class_begin() | LOOKAHEAD(2) res = Class_end() | @@ -1117,6 +1148,26 @@ PotentialCPDefineConstruct Potential_commit_point_define() : } } +PotentialCPDefineConstruct Potential_additional_ordering_point_define() : +{ + PotentialCPDefineConstruct res; + String label, condition; + ArrayList content; +} +{ + + { res = null; } + + (content = C_CPP_CODE(null) { condition = stringArray2String(content); }) +