« first day (319 days earlier)      last day (2861 days later) » 
00:00 - 19:0019:00 - 00:00

19:01
LOL IKR
@Mat'sMug You know how you said you want to have the GUID's start with the same value? Have you done that yet?
Want me to?
I didn't really mean it. It would just have made my life easier when I was manually scrubbing the 238 installed versions in my registry...
Oh, OK.
It actually wouldn't be a bad idea, I don't think.
19:08
Holy crap I have gnerated code!
a calculator grammar?
No idea what it actually does or anything, but.... ya know. It built!\
did you build a tree listener for your parser?
@Mat'sMug The beginnings of one I think.
you need to have a listener abstract class somewhere, it makes life much easier for walking the parse tree
19:10
Do I need to copy the tokens file?
What is that?
what did you call the grammar?
BasicMath.g4
so you should have a BasicMathLexer, a BasicMathParser, and I'm talking about the BasicMathBaseListener class
Okay. I see it.
and you might also have a BasicMathBaseVisitor but I don't know what it does
I think it's related to the tree walker
19:12
LOL
now, create a new class and derive it from the listener base class
you should be able to override a virtual method for each grammar rule you defined
All my Listener has is an EnterCompileUnit and an ExitCompileUnit. I think my grammar is messed up.
lol
there's a compileUnit rule?
does your parser have GrammarRuleName : ParserRuleContext nested types?
I have no idea what I'm doing.
2
show me your grammar
19:17
I feel like a toddler playing with an iPad.
2
grammar BasicMath;

/*
 * Parser Rules
 */

compileUnit
	:	EOF
	;

/*
 * Lexer Rules
 */

OPERATION : (PLUS|MINUS|DIVIDE|MULTIPLY);

MULTIPLY : '*';
DIVIDE : '/';
MINUS : '-';
PLUS : '+';

WS : ' ' -> channel(HIDDEN);
So, if I'm reading this right, I defined some tokens, but no rules.
exactly
and I see why you only have a compileUnit() method
2 hours ago, by Mat's Mug
startRule : module EOF;
Not sure if that has anything to do with it.
make that compileUnit : (colon on the same line)
@Hosch250 it does
you need a grammar rule that defines an expression or something
and you need numeric tokens I guess
@Mat'sMug that seems... a little personal...
19:20
> Show your tentacles - ALL of them!
From Penguins of Madagascar.
@ticker another tab-illetterate
@RubberDuck something like this:
INTEGERLITERAL : (PLUS|MINUS)? ('0'..'9')+ ( ('e' | 'E') INTEGERLITERAL)* ('#' | '&')?;
wait that's too complex
NUMBERLITERAL : ('0'..'9')+;
and your OPERATION rule looks like it should be called OPERATOR
so you'd have something like..
expression : (NUMBERLITERAL WS? OPERATOR WS? NUMBERLITERAL)+;
@Mat'sMug I think this will work for an integer.
INTEGERLITERAL ('0'..'9');
that's just one digit
Oops. Right.
compileUnit : expression EOF;
19:27
> He has demonstrated proficiency in both debugging and re-bugging
4
I like the "re-bugging" part.
I guess the question mark makes it optional?
as in regex, yeah -> "zero or one"
+ -> "one or more"
* -> "zero or many"
then you'll want to build operator precedence into the grammar
because as it is, the expression rule is "flat"
This is seriously some strange foreign language that I just don't understand.
Anyone know what this guy means?
9
Q: Printing a pyramid

user70827Can you please review this code to determine if it's good or can be improved? #include "stdafx.h" #include <iostream> #include <string> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int h = 20; int bl = 1; while (h != 0) { for (int i = 0; i != h; i++) { ...

Darn, I mean the comment, not the question!
9
Q: Printing a pyramid

user70827Can you please review this code to determine if it's good or can be improved? #include "stdafx.h" #include <iostream> #include <string> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int h = 20; int bl = 1; while (h != 0) { for (int i = 0; i != h; i++) { ...

Hmmph.
#Fail
@RubberDuck TBH I don't get all of it - I wouldn't have borked the grammar otherwise
19:42
I don't know if borked is the right word.
2 hours ago, by Hosch250
> Bork: obstruct (someone, especially a candidate for public office) through systematic defamation or vilification:
You were vilifying InstallShield more than the grammar, but it didn't bork it either.
> why use a for loop? While loops are better, at least you can prove while loops.
Anyway, what does that guy mean?
Sounds loony to me...
> To have totally fucked something up. Usually by doing something stupid. Specifically used to describe technology that is broken.
@Mat'sMug I don't use UD - too inaccurate.
I have never yet seen an accurate definition from them.
^^^ here's one
not "bork", "borked"
19:47
"borked" is the past tense of "bork". Where's your grammar?
JK, just a pun on the ANTLR grammar.
it's borked, I just told you ;)
Ooh, another one.
OK, which politician was defaming it? Do we need a lawyer?
huh?
I only know the slang definition for "borked" meaning "broken"
Origin

1980s: from the name of Robert Bork (1927–2012), an American judge whose nomination to the US Supreme Court (1987) was rejected following unfavorable publicity for his allegedly extreme views.
> (as noun borking) 'is fear of borking scaring people from public office?'
20:09
@Mat'sMug found the offending line in the VBA grammar github.com/retailcoder/Rubberduck/blob/master/…
how so?
lineLabel : (ambiguousIdentifier ':' WS) | lineNumber;

lineNumber : (INTEGERLITERAL WS);
block : lineLabel? blockStmt (NEWLINE+ WS? blockStmt)* NEWLINE*;
Wait. No. Nevermind. I'm a dunce still.
I think the error is in the block rule
20:11
Trying to build a template for a lexer yourself?
block : lineLabel? blockStmt (NEWLINE+ lineLabel? WS? blockStmt)* NEWLINE*;
^^ perhaps
@skiwi he's making an ANTLR grammar for his calculator
and I'm trying to debug our borked broken VBA grammar
Ah... for a calculator, not for Rubberduck
it's good for learning ANTLR and eventually diving into the VBA grammar ;)
@RubberDuck in case you're missing that conversation: github.com/retailcoder/Rubberduck/issues/…
20:33
Well, I've created a lexer, but I don't know what to do with it.
        private IParseTree Parse(string code, out TokenStreamRewriter outRewriter)
        {
            var input = new AntlrInputStream(code);
            var lexer = new VBALexer(input);
            var tokens = new CommonTokenStream(lexer);
            var parser = new VBAParser(tokens);
            outRewriter = new TokenStreamRewriter(tokens);

            var result = parser.startRule();
            return result;
        }
you supply your BasicMathParser with a CommonTokenStream instance, itself supplied with an instance of your BasicMathLexer, itself supplied with an AntlrInputStream that takes your string input.
then you get an IParseTree out of running parser.compileUnit()
and you can break and explore the contents of the IParseTree
I'm missing a step here I think.
you have the generated lexer & parser classes?
the lexer is used for turning your input string into a TokenStream, which the parser takes for input
Yup. Did all that, but it's telling me that I cannot assign a method group to an implicitly typed variable when I call parser.compileUnit
what's your code looking like?
20:41
    class Program
    {
        static void Main(string[] args)
        {
            var lexer = new BasicMathLexer(new AntlrInputStream("6 + 4"));
            var tokens = new CommonTokenStream(lexer);
            var parser = new BasicMathParser(tokens);

            BasicMathParser.CompileUnitContext idk = parser.compileUnit;

        }
    }
> Error 1 Cannot convert method group 'compileUnit' to non-delegate type 'Calculator.BasicMathParser.CompileUnitContext'. Did you intend to invoke the method? c:\users\x1ucjk2\documents\visual studio 2013\Projects\Calculator\Calculator\Program.cs 18 54 Calculator
you're missing the parens
it's a method
Yup! lol
Oops.
lol and the error description says nothing I wouldn't have said
> Did you intend to invoke the method?
I know. I found it the second I pasted it in and hit enter.
good!
so it works now?
20:44
Kind of. I think.
the CompileUnitContext should have an expression() method
well depending on your grammar
so you could do string left = parser.compileUnit().expression().INTEGERLITERAL()[0].GetText();
and string right = parser.compileUnit().expression().INTEGERLITERAL()[1].GetText();
and string operator = parser.compileUnit().expression().OPERATION();
right?
That seems kind of silly.
that's because you're walking the tree yourself
I should be able to actually do something with this thing.
like what?
20:50
Idk.
But I do have all three tokens stored in the context.Children property. =)
yeah
and you also have their exact location in the input stream, too
children like tokens! They're good for games.
hmm..... + is showing up as an error node. That doesn't seem right.
indeed
what's your grammar again?
I started my calculator too, but I doubt I'll get it in in April:
    static class ExtensionMethods
    {
        public static string RemoveAll(this string me, char charToRemove)
        {
            for(int i = 0; i < me.Length; i++)
            {
                if (me[i] == charToRemove)
                {
                    me = me.Remove(i, 1);
                }
            }
            return me;
        }
    }

    enum Operators
    {
        Addition, Subtraction, Multiplication, Division
    }

    class Project
    {
        static Operators getNextOperator(string equation, ref int currentIndex)
20:53
I didn't. I only worked on RD.
I'm not real happy with it.
Fixed it.
Had somethigng in there that shouldn't have been.
So, I have successfully parsed a simple string.
Now I need to figure out how to use it.
^^ we could tweak the VBA grammar and make an expression evaluator
..I wonder if there's such a thing for the C# target
TTGH
later!
21:11
@Mat'sMug bookmarked. Thanks
that's what the darn Visitor is for!
we might actually turn this into a very dumbed-down VBA interpreter to evaluate simple conditionals... maybe. don't quote me on that.
> There are 100 open issues
22:04
TTQW too :D
I'm working on RD.
I'm doing a GenericProjectNameInspection.
I'm not quite sure where to take it from here.
I can't test it because I have 64-bit Office - guess I'll need to finish it later.
@Hosch250 Pull master - my 64-bit debug build works
@Mat'sMug OK.
When did it start working?
I have it from the weekend when the main build wasn't working.
Yesterday :)
22:30
3>RegAsm : error RA0000: Unable to locate input assembly 'C:\Users\Hosch250\Documents\Visual Studio 2013\Projects\Rubberduck\RetailCoder.VBE\bin\Debug64\Rubberduck.dll' or one of its dependencies.
3>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1131,5): error MSB3073: The command "if Debug64 == Debug64 (
3>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1131,5): error MSB3073:     c:\windows\microsoft.net\framework64\v4.0.30319\regasm.exe "C:\Users\Hosch250\Documents\Visual Studio 2013\Projects\Rubberduck\RetailCoder.VBE\bin\
Hmm, what about that?
The pre-build command is failing.
It builds fine without the prebuild command, but still fails.
NVM, was trying to build the 64-bit installer.
I unloaded that project, and everything builds, but I can't see it in the VBE.
Yup. I'm exactly no closer to understanding that CodeProject article...
22:59
@Mat'sMug Do you know what is happening?
I installed the project, built it and ran it, and everything went fine, but Rubberduck isn't loading.
If I uninstall the project, the VBE can't find Rubberduck.
And the AboutWindow and everything still have ComVisible(true).
00:00 - 19:0019:00 - 00:00

« first day (319 days earlier)      last day (2861 days later) »